Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Peculiar effect of wish on MinGW

70 views
Skip to first unread message

Arjen Markus

unread,
Aug 1, 2017, 3:14:27 AM8/1/17
to
Hello,

I was checking a small program on MinGW the other day and noticed the following:
If you start wish in the MinGW shell and open a console window via "console show", you can type in commands in that console, but the results are shown in the original MinGW shell.

This MinGW shell is somewhat awkward to begin with, output from programs is not shown immediately, but still, this behaviour is surprising.

Receipe for reproducing:
- Start the MinGW shell (mingw64.exe for instance)
- Save a small Tcl script, containing the "console show" command only
- Start wish (the MinGW one) with this script
- Type a command like "puts Hello" in the console
- The result appears in the MinGW window, not in the console window

Also the prompts in the console window are missing after the first one. All seems to be redirected to the MinGW window.

I am not sure this is something serious as the MinGW window is useable as an interactive shell (when you realise it does not produce the prompt immediately), just thought I'd mention it.

Regards,

Arjen

Paul Obermeier

unread,
Aug 1, 2017, 1:22:30 PM8/1/17
to
Hi Arjen,

I cannot reproduce that effect.
Tested with the MSys/MinGW distributions of BAWT.

Regards,
Paul

Arjen Markus

unread,
Aug 1, 2017, 3:18:23 PM8/1/17
to
Thanks for that test.

I use the Tcl/Tk version that comes with Msys2/MinGW-w64 (to specify it completely). It may have something specific, so that would be a MinGW problem rather than a Tcl/Tk one.

Regards,

Arjen

Paul Obermeier

unread,
Aug 1, 2017, 3:45:27 PM8/1/17
to
Well, wish behaves correctly fro me when using the MSys built-in
(/bin/wish.exe 8.5.13) as well as using the BAWT compiled one (which is
8.6.6).

Paul

Arjen Markus

unread,
Aug 1, 2017, 4:07:50 PM8/1/17
to
Hm, the installation on my machine is 8.6.6, but I noticed another thing: tclsh and wish do not produce any output unless I use puts explicitly.

[parray tcl_platform] gives:
tcl_platform(byteOrder) = littleEndian
tcl_platform(engine) = Tcl
tcl_platform(machine) = amd64
tcl_platform(os) = Windows NT
tcl_platform(osVersion) = 6.1
tcl_platform(pathSeparator) = ;
tcl_platform(platform) = windows
tcl_platform(pointerSize) = 8
tcl_platform(threaded) = 1
tcl_platform(user) = markus
tcl_platform(wordSize) = 4


Regards,

Arjen

Arjen Markus

unread,
Aug 1, 2017, 4:14:43 PM8/1/17
to
By the way, a short session with tclsh (and wish) looks like this:

$ /mingw64/bin/tclsh
info patch
puts [info patch]
8.6.6
exit

as you can see, there is no prompt and no output, unless I use [puts]. (The above was using the MSYS2 shell)

Regards,

Arjen

Dave

unread,
Aug 1, 2017, 4:31:32 PM8/1/17
to
On 8/1/2017 3:14 PM, Arjen Markus wrote:

>
> By the way, a short session with tclsh (and wish) looks like this:
>
> $ /mingw64/bin/tclsh
> info patch
> puts [info patch]
> 8.6.6
> exit
>
> as you can see, there is no prompt and no output, unless I use [puts]. (The above was using the MSYS2 shell)
>

Use task manager to see what terminal emulator you are using. If mintty,
then the problem is that it uses pipes for stdin/out/err. Thus the
isatty() function always returns false.

I use msys2 and finally switched to ConEmu. There are other replacements
you can google for.

--
computerjock AT mail DOT com

Arjen Markus

unread,
Aug 2, 2017, 2:37:56 AM8/2/17
to
Ah, indeed, it is mintty that is behind the console/command window. Thanks for clarifying this. Nothing wrong with tclsh/wish then, merely the peculiarity of the console emulator.

Regards,

Arjen
0 new messages