• console not working

    From Luc@21:1/5 to All on Tue Dec 17 18:51:10 2024
    I am trying to run the 'console show' command. But Tk is not having it.

    Error in startup script: invalid command name "console"
    while executing
    "console show"
    (file "p1.tcl" line 4)
    Compilation failed.


    To my dismay, the manual says,

    "Except for TkAqua, this command is not available when Tk is loaded
    into a tclsh interpreter with 'package require Tk' as a conventional
    terminal is expected to be present in that case."

    I guess I will never understand that decision. So what if a terminal
    is expected to be present? How about letting that decision up to us?

    Anyway, I try to run the script with wish and the same error happens

    Any solution to that?

    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to Rich on Tue Dec 17 21:15:08 2024
    On Wed, 18 Dec 2024 00:06:44 -0000 (UTC), Rich wrote:

    It is also only available on Windows (and maybe Mac) builds.

    Linux (Unix) builds don't include it because a 'console' is already
    available as the terminal emulator you launch the script from.

    So if you are launchin p1.tcl on Linux, you'll get that error if you
    try to do 'console show'.

    The typical replacement under Linux is tkcon >https://wiki.tcl-lang.org/page/Tkcon
    **************************

    You don't say.


    Then I can't follow the guidance that Michael Niehren gave me
    yesterday regarding capturing the output of a tclexecomp packed
    executable.

    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Luc on Wed Dec 18 00:06:44 2024
    Luc <luc@sep.invalid> wrote:
    I am trying to run the 'console show' command. But Tk is not having it.

    Error in startup script: invalid command name "console"
    while executing
    "console show"
    (file "p1.tcl" line 4)
    Compilation failed.


    To my dismay, the manual says,

    "Except for TkAqua, this command is not available when Tk is loaded
    into a tclsh interpreter with 'package require Tk' as a conventional
    terminal is expected to be present in that case."

    I guess I will never understand that decision. So what if a terminal
    is expected to be present? How about letting that decision up to us?

    Anyway, I try to run the script with wish and the same error happens

    Any solution to that?

    It is also only available on Windows (and maybe Mac) builds.

    Linux (Unix) builds don't include it because a 'console' is already
    available as the terminal emulator you launch the script from.

    So if you are launchin p1.tcl on Linux, you'll get that error if you
    try to do 'console show'.

    The typical replacement under Linux is tkcon https://wiki.tcl-lang.org/page/Tkcon

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to All on Wed Dec 18 01:24:58 2024
    Am 17.12.24 um 22:51 schrieb Luc:
    I am trying to run the 'console show' command. But Tk is not having it.

    Error in startup script: invalid command name "console"
    while executing
    "console show"
    (file "p1.tcl" line 4)
    Compilation failed.


    To my dismay, the manual says,

    "Except for TkAqua, this command is not available when Tk is loaded
    into a tclsh interpreter with 'package require Tk' as a conventional
    terminal is expected to be present in that case."

    I guess I will never understand that decision. So what if a terminal
    is expected to be present? How about letting that decision up to us?

    Anyway, I try to run the script with wish and the same error happens

    Any solution to that?

    Hello,
    regarding console,
    there are also differences between wish and tclsh on Windows: http://www.tcl.tk/man/tcl/UserCmd/wish.htm#M14

    One solution would be:
    https://wiki.tcl-lang.org/page/console+for+Unix
    a wrapper for console.tcl in $tk_library

    Also works with Windows.

    Gregor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to greg on Tue Dec 17 22:05:58 2024
    On Wed, 18 Dec 2024 01:24:58 +0100, greg wrote:

    Hello,
    regarding console,
    there are also differences between wish and tclsh on Windows: >http://www.tcl.tk/man/tcl/UserCmd/wish.htm#M14

    One solution would be:
    https://wiki.tcl-lang.org/page/console+for+Unix
    a wrapper for console.tcl in $tk_library

    Also works with Windows.

    Gregor
    **************************

    Thanks.

    I ended up just making a text widget and using it as a debugger
    pad.

    Then I realized it's not possible to do what I wanted to do.
    I was hoping I could look inside the internal tclexecomp
    file system. I want to source a packed file. I'm not sure that
    can be done. Freewrap does that. I think tclexecomp doesn't.

    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Niehren@21:1/5 to All on Wed Dec 18 09:36:18 2024
    Hi Luc,

    you have access to the internal tclexecomp filesystem over the
    /cvfs
    mountpoint. It is mounted read-only on runtime. To take a look you can use
    the "normal" filesystem commands like glob, file copy, ...

    Greetings,
    Michael



    On Wed, 18 Dec 2024 01:24:58 +0100, greg wrote:

    Hello,
    regarding console,
    there are also differences between wish and tclsh on Windows: >>http://www.tcl.tk/man/tcl/UserCmd/wish.htm#M14

    One solution would be:
    https://wiki.tcl-lang.org/page/console+for+Unix
    a wrapper for console.tcl in $tk_library

    Also works with Windows.

    Gregor
    **************************

    Thanks.

    I ended up just making a text widget and using it as a debugger
    pad.

    Then I realized it's not possible to do what I wanted to do.
    I was hoping I could look inside the internal tclexecomp
    file system. I want to source a packed file. I'm not sure that
    can be done. Freewrap does that. I think tclexecomp doesn't.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Niehren@21:1/5 to All on Wed Dec 18 09:31:20 2024
    the "console" command is also availiable in the linux version of tclexecomp

    call your script with without wrapping
    tclexecomp64 p1.tcl

    so the "console show" command will work and an extra console window will
    be opened. There you can see the Output of stdout and stderr.



    I am trying to run the 'console show' command. But Tk is not having it.

    Error in startup script: invalid command name "console"
    while executing
    "console show"
    (file "p1.tcl" line 4)
    Compilation failed.


    To my dismay, the manual says,

    "Except for TkAqua, this command is not available when Tk is loaded
    into a tclsh interpreter with 'package require Tk' as a conventional
    terminal is expected to be present in that case."

    I guess I will never understand that decision. So what if a terminal
    is expected to be present? How about letting that decision up to us?

    Anyway, I try to run the script with wish and the same error happens

    Any solution to that?


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)