Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Telnet and windows characters

 
Jekin Eiriksen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks,
My first post here, so be gentle

I seem to have run into a quite a problem with the MS telnet server. I'm writing an application that will connect to a remote machine and execute a few scripts there.
I'm using jakarta net for the connection. It all seems to work fine, but when I do connect to the machine, I'm getting a whole load of MS-specific mumbo jumbo that I can't seem to avoid. Here's how it looks from my side:

$ java TelnetConnect
Microsoft (R) Windows (TM) Version 5.00 (Build 2195)
Welcome to Microsoft Telnet Service
Telnet Server Build 5.00.99201.1
login:
password:
***←[1;1H*=============================================================== ←[2;1HWelcome to Microsoft Telnet Server.
←[3;1H*===============================================================
←[4;1HC:\> sh javatest/test.ksh
←[5;1H←[K←[6;1H←[K←[7;1H←[K←[8;1H←[K←[9;1H←[K←[10;1H←[K
←[11;1H←[K←[12;1H←[K←[13;1H←[K←[14;1H←[K←[15;1H←[K←[16;1H←[K←[17;1H←[K←[18;1H←[K←[19;1H←[K←[20;1H←[K←[21;1H←[K←[22;1H←[K←[23;1H←[K
←[24;1H←[K←[25;1H←[K←[4;5H←[4;5Hsh javatest/test.ksh←[5;1HTest.ksh from RUSH was successful!←[7;1HC:\>ls -1
←[7;5H←[1;1HProgram Files ←[2;1HRegister ←[3;1HWINNT
←[4;1HWinZip ←[5;1Hbc_Build_bundle031.txt ←[6
;1Hcshrc.csh←[7;1Henviron.ksh←[8;1Hide.log←[9;1Hinf.log←[10;1HinstallFiles←[11;1Hjavatest←[12;1Hlogin.csh←[13;1Hlogout.csh←[14;1Hm
ks←[15;1Hp4←[16;1Hp4_wa←[17;1Hprofile.ksh←[18;1Hsh_histo←[19;1Htemp←[20;1Husr←[21;1Hvcvars32.bat←[22;1Hvcvars32.ksh←[23;1Hvideo.lo
g←[25;1HC:\>

---------------------------------------------------------
Now, when I connect to a unix machine, it all seems to work perfectly.

Is there some parser package for this or a connection option? I looked everywhere and can't seem to find a solution.

Thanks!
 
Alex Pakhomov
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jekin, are you running your program in a DOS window? If yes, it does not understand VT100 (or other terminal's) control characters. The XTerm window does terminal emulation correctly.
 
Jekin Eiriksen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Alex,

I tried running this from within MKS Toolkit (Korn shell), Cygwin, and cmd - all with the same result
 
Van Glass
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
terminal emulation is supposed to be option as part of the option negotiation process. Unfortunately the telnet server that comes with Windows seems to be a poor implementation as it ignores the telnet client when the telnet client refuses terminal emulation. In this case the Windows server sends the emulated data anyway. Unfortunately the only option is to use a different server that properly follows the option negotiation standard or parse the emulated data.
 
Jekin Eiriksen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clarification Van Glass! I guess I'll have to find a new server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic