small improveents in "Execute tcl command"

This commit is contained in:
stefan schippers 2025-10-27 08:43:27 +01:00
parent 5c41eabcd6
commit 1583c83d96
2 changed files with 5 additions and 4 deletions

View File

@ -1866,6 +1866,7 @@ void launcher(void)
if(url[0] || (program[0])) { /* open url with appropriate program */
tclvareval("launcher {", url, "} {", program, "}", NULL);
} else if(command && command[0]){
dbg(1, "launcher(): command=%s\n", command);
if(Tcl_GlobalEval(interp, command) != TCL_OK) {
dbg(0, "%s\n", tclresult());
if(has_x) tclvareval("alert_ {", tclresult(), "} {}", NULL);

View File

@ -6307,8 +6307,8 @@ proc return_release {window} {
proc tclcmd_ok_button {} {
global tclcmd_txt tclcmd_puts
set tclcmd_txt [.tclcmd.t get 1.0 end]
regsub {^ *= *} $tclcmd_txt {= } tclcmd_txt
set tclcmd_txt [.tclcmd.t.t get 1.0 end]
regsub -all -line {^ *= *} $tclcmd_txt {= } tclcmd_txt
redef_puts
catch {uplevel #0 $tclcmd_txt} tclcmd_puts
rename puts {}
@ -6336,11 +6336,11 @@ proc tclcmd {} {
}
frame .tclcmd.t
text .tclcmd.t.t -width 60 -height 4 -font {Monospace 12} -yscrollcommand ".tclcmd.t.yscroll set"
text .tclcmd.t.t -width 60 -height 4 -font {Monospace 10} -yscrollcommand ".tclcmd.t.yscroll set"
scrollbar .tclcmd.t.yscroll -command ".tclcmd.t.t yview"
frame .tclcmd.r
text .tclcmd.r.r -width 60 -height 5 -font {Monospace 12} -yscrollcommand ".tclcmd.r.yscroll set"
text .tclcmd.r.r -width 60 -height 5 -font {Monospace 10} -yscrollcommand ".tclcmd.r.yscroll set"
scrollbar .tclcmd.r.yscroll -command ".tclcmd.r.r yview"
.tclcmd.p add .tclcmd.t .tclcmd.r