Index: library/lib/nx-shell.tcl =================================================================== diff -u -N -rf1bfcbcc730df02b59b395c51876871398958ec8 -r4b929805d1acbf4fd07b6a969c2223467416523b --- library/lib/nx-shell.tcl (.../nx-shell.tcl) (revision f1bfcbcc730df02b59b395c51876871398958ec8) +++ library/lib/nx-shell.tcl (.../nx-shell.tcl) (revision 4b929805d1acbf4fd07b6a969c2223467416523b) @@ -4,7 +4,6 @@ nx::Object create ::nx::shell { :public object method run {argc argv} { - uplevel #0 {namespace import -force ::nx::*} if {$argc == 0} { set prefix "" set line "" Index: library/xotcl/xotclsh.in =================================================================== diff -u -N -rf6b33f642a1d30f8d7b44c556c86302f8539be3c -r4b929805d1acbf4fd07b6a969c2223467416523b --- library/xotcl/xotclsh.in (.../xotclsh.in) (revision f6b33f642a1d30f8d7b44c556c86302f8539be3c) +++ library/xotcl/xotclsh.in (.../xotclsh.in) (revision 4b929805d1acbf4fd07b6a969c2223467416523b) @@ -11,38 +11,16 @@ puts [info nameofexecutable] # -# Tiny scripted replacement of a binary nxsh. This script can be used -# as interactive shell for testing or like a regular shell with the !# +# Tiny scripted replacement of a binary xotclsh. This script can be used +# as interactive shell for testing or like a regular shell with the #! # markup in the first line of a script. It is designed to work with # multiple installed shells during development. For installed # versions, it should be sufficient to remove the first line. # + package require XOTcl 2.0 +package require nx::shell + namespace import -force ::xotcl::* -if {$argc == 0} { - set prefix "" - set line "" - while {1} { - if {$line eq ""} { - puts -nonewline "% " - flush stdout - } - append line [gets stdin] - if {[info complete $line]} { - if {[catch $line result]} { - puts $::errorInfo - } else { - puts $result - } - set line "" - continue - } - append line \n - } -} else { - set argv0 [lindex $argv 0] - set argv [lreplace $argv 0 0] - incr argc -1 - source $argv0 -} +nx::shell run $argc $argv Index: library/xotcl/xowish.in =================================================================== diff -u -N -rf6b33f642a1d30f8d7b44c556c86302f8539be3c -r4b929805d1acbf4fd07b6a969c2223467416523b --- library/xotcl/xowish.in (.../xowish.in) (revision f6b33f642a1d30f8d7b44c556c86302f8539be3c) +++ library/xotcl/xowish.in (.../xowish.in) (revision 4b929805d1acbf4fd07b6a969c2223467416523b) @@ -11,41 +11,17 @@ puts [info nameofexecutable] # -# Tiny scripted replacement of a binary nxwish (former xowish). This +# Tiny scripted replacement of a binary xowish. This # script can be used as interactive shell for testing or like a -# regular shell with the !# markup in the first line of a script. It +# regular shell with the #! markup in the first line of a script. It # is designed to work with multiple installed shells during # development. For installed versions, it should be sufficient to # remove the first line. # package require Tk package require XOTcl 2.0 +package require nx::shell + namespace import -force ::xotcl::* -if {$argc == 0} { - set prefix "" - set line "" - while {1} { - update - if {$line eq ""} { - puts -nonewline "% " - flush stdout - } - append line [gets stdin] - if {[info complete $line]} { - if {[catch $line result]} { - puts $::errorInfo - } else { - puts $result - } - set line "" - continue - } - append line \n - } -} else { - set argv0 [lindex $argv 0] - set argv [lreplace $argv 0 0] - incr argc -1 - source $argv0 -} +nx::shell run $argc $argv Index: nxsh.in =================================================================== diff -u -N -r4bf0e8a0dc38bb3afda612c028abaa714fe086e1 -r4b929805d1acbf4fd07b6a969c2223467416523b --- nxsh.in (.../nxsh.in) (revision 4bf0e8a0dc38bb3afda612c028abaa714fe086e1) +++ nxsh.in (.../nxsh.in) (revision 4b929805d1acbf4fd07b6a969c2223467416523b) @@ -12,9 +12,12 @@ # # Tiny scripted replacement of a binary nxsh. This script can be used -# as interactive shell for testing or like a regular shell with the !# +# as interactive shell for testing or like a regular shell with the #! # markup in the first line of a script. It is designed to work with # multiple installed Tcl shells during development. # package require nx::shell + +namespace import -force ::nx::* + nx::shell run $argc $argv Index: nxwish.in =================================================================== diff -u -N -r4bf0e8a0dc38bb3afda612c028abaa714fe086e1 -r4b929805d1acbf4fd07b6a969c2223467416523b --- nxwish.in (.../nxwish.in) (revision 4bf0e8a0dc38bb3afda612c028abaa714fe086e1) +++ nxwish.in (.../nxwish.in) (revision 4b929805d1acbf4fd07b6a969c2223467416523b) @@ -13,11 +13,14 @@ # # Tiny scripted replacement of a binary nxwish (former xowish). This # script can be used as interactive shell for testing or like a -# regular shell with the !# markup in the first line of a script. It +# regular shell with the #! markup in the first line of a script. It # is designed to work with multiple installed Tcl shells during # development. # package require Tk package require nx::shell + +namespace import -force ::nx::* + nx::shell run $argc $argv