Menu

#96 Normalize [console]

open
7
2004-03-02
2002-03-20
Don Porter
No

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.

Discussion

  • Don Porter

    Don Porter - 2003-11-13

    Logged In: YES
    user_id=80530

    see also 480944

     
  • Don Porter

    Don Porter - 2004-03-02

    Logged In: YES
    user_id=80530

    This topic is getting hot on
    TCLCORE.

     
  • Don Porter

    Don Porter - 2004-03-02
    • priority: 5 --> 7
    • assigned_to: chengyemao --> hobbs
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.