diff options
author | hobbs <hobbs> | 2005-05-31 04:58:00 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2005-05-31 04:58:00 (GMT) |
commit | ea6df4f7761a3420887af0707cc26efc1287e2aa (patch) | |
tree | bc074b56b8e8ea721c9ef9d124435a09d70675c6 /library/console.tcl | |
parent | 4ee00fb00bd41275a852056e3eb6093c1d7abdc2 (diff) | |
download | tk-ea6df4f7761a3420887af0707cc26efc1287e2aa.zip tk-ea6df4f7761a3420887af0707cc26efc1287e2aa.tar.gz tk-ea6df4f7761a3420887af0707cc26efc1287e2aa.tar.bz2 |
more elaborate variant of getting first prompt shown to avoid
a puts call.
Diffstat (limited to 'library/console.tcl')
-rw-r--r-- | library/console.tcl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/library/console.tcl b/library/console.tcl index 0f4e983..041423f 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -4,7 +4,7 @@ # can be used by non-unix systems that do not have built-in support # for shells. # -# RCS: @(#) $Id: console.tcl,v 1.22.2.2 2005/05/30 23:40:33 hobbs Exp $ +# RCS: @(#) $Id: console.tcl,v 1.22.2.3 2005/05/31 04:58:00 hobbs Exp $ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. @@ -138,7 +138,19 @@ proc ::tk::ConsoleInit {} { $con mark set promptEnd insert $con mark gravity promptEnd left - ConsolePrompt + # A variant of ConsolePrompt to avoid a 'puts' call + set w $con + set temp [$w index "end - 1 char"] + $w mark set output end + if {![consoleinterp eval "info exists tcl_prompt1"]} { + set string [EvalAttached $::tk::console::defaultPrompt] + $w insert output $string stdout + } + $w mark set output $temp + ::tk::TextSetCursor $w end + $w mark set promptEnd insert + $w mark gravity promptEnd left + if {$tcl_platform(platform) eq "windows"} { # Subtle work-around to erase the '% ' that tclMain.c prints out after idle [list $con delete 1.0 output] |