Take Command crashes with TELNET

May 30, 2008
80
0
Gerakas, Greece
When opening telnet.exe (the standard Windows' telnet client), it's quite often (not *all* times, but there seems to be a pattern) that, when exiting telnet, TCMD.EXE crashes (TCMD window goes to white and closes). This does not happen if you detach the related TCC (or cmd) tab.

This is probably some TELNET problem, rather than a TCMD problem, but the fact remains that all of TCMD closes. I've tried the same pattern with Console2 (an open source project with similar functionality as TCMD shell), and it crashed as well.

I think the pattern is opening telnet to some (open) port, but of a protocol that doesn't echo back (I'm using RDP for my example).

From tcc.exe (standalone)

(my input is in red, special stuff in green)


C:\Users\GSchizas>telnet localhost 3389

(screen clears)

(Ctrl+])

Welcome to Microsoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet>q


Same thing in tcc.exe under tcmd shell


C:\Users\GSchizas>telnet localhost 3389

(screen clears)

(Ctrl+])

(screen clears again!)

q(blindly)

(TCMD closes)



I have attached Visual Studio to TCMD.EXE, TCC.EXE and TELNET.EXE before this happens but there wasn't anything meaningful in the output (just a series of program exits with code 0). I've also tried it without plugins (same result).

TCMD 13.0.19 x64 on Windows 7 SP1 64-bit
 

rconn

Administrator
Staff member
May 14, 2008
12,556
167
When opening telnet.exe (the standard Windows' telnet client), it's quite often (not *all* times, but there seems to be a pattern) that, when exiting telnet, TCMD.EXE crashes (TCMD window goes to white and closes). This does not happen if you detach the related TCC (or cmd) tab.

This is a known Windows bug -- the crash is actually occurring in conhost, not TCMD (or Console2). The Microsoft Telnet app is changing the console buffer after it starts (which certainly isn't necessary; I suspect the developer just thought it would be "cool"). That will confuse TCMD (which has no way of knowing that a console app has switched to a different buffer). But conhost *really* doesn't like it (and crashes) when a hidden console app switches its buffer.

The only workarounds are either to (1) run Telnet in a stand-alone console window, or preferably (2) switch to another Telnet app (like Putty).

(Or you could wait for Microsoft to fix conhost and/or Telnet, but it might be a looooooonnnnnggg wait ...)
 
May 30, 2008
80
0
Gerakas, Greece
This is a known Windows bug

I supsected as much...

The only workarounds are either to (1) run Telnet in a stand-alone console window, or preferably (2) switch to another Telnet app (like Putty).

Unfortunately PuTTY is not console based. Any idea where I could find a console telnet replacement? (or, do you have one under wraps? :))

Thanks anyway :)
 
May 30, 2008
80
0
Gerakas, Greece
Unfortunately PuTTY is not console based.

I'm an idiot. I never knew about plink (which is indeed console based - although it doesn't seem to handle ANSI escape sequences very well)
 
May 26, 2008
550
6
If this is solely a telnet/conhost bug, why does it not crash when run independently (not attached to TCMD)?
 
May 20, 2008
12,167
133
Syracuse, NY, USA
On Tue, 13 Sep 2011 16:42:31 -0400, gschizas <> wrote:

|Unfortunately PuTTY is not console based. Any idea where I could find a console telnet replacement? (or, do you have one under wraps? :))

There's good old Kermit ... about as full-featured as will ever be. But I can't
comment on the last twelve years of its development (or lack of development).
 
May 29, 2008
43
0
> Unfortunately PuTTY is not console based. Any idea where I could find a console
> telnet replacement? (or, do you have one under wraps? )

There is TTERMPRO from hp.vector.co.jp/authors/VA002416/teraterm.html. It
hasn't been updated since 1999 but version 2.3 for Win 95/NT does work under
current Windows versions.

Dennis
 

Similar threads