On Windows and Mac, wish (not Tk!) includes a
[console] command for controlling a console to
which it redirects Tcl's stdout and stderr channels.
When [package require Tk] brings Tk into a tclsh,
there is no [console] and there is no console.
On Unix, there is no console and no [console].
It is simple to add [console] to wish on Unix, by
enabling the Tk_InitConsoleChannels in Tk_Main and
adding a call to Tk_CreateConsoleWindow in Tcl_AppInit.
However, this has the effect of losing access to the
real standard channels -- a big loss on Unix.
On Windows, with the makefile.vc, one can build a
wishc.exe program that behaves more like wish on
Unix. No [console] and use of the "real" standard
channels of a DOS console.
Because of all these variants it is somewhat
unpleasant to write code that tries to use [console],
with [catch]es or [if $tcl_platform...] all over the
place.
A revisions that normalized the availability and
behavior of [console] would be welcome.
Logged In: YES
user_id=80530
see also 480944
Logged In: YES
user_id=80530
This topic is getting hot on
TCLCORE.