PDA

View Full Version : Bash or Telnet weirdness?


markhargrove
07-10-2005, 10:05 PM
I have what I suspect is a simple question, but I've not been able to find an answer (probably because I just can't find the right search keywords). If anybody can help me, I'd appreciate it.

I've just finished hacking my HR10-250 and all looks good -- with one very minor annoyance. Every time I press the 'Enter' key at the end of a bash prompt during a telnet session, I get an extra LF. The symptom is that I always get a double bash prompt. For example, if I type:

bash-2.02# ls <Enter>
filename1 filename2 filename3
bash-2.02#
bash-2.02#

The shell is clearly seeing an extra CR or LF, but I don't know how to correct this. I thought it might be an artifact of puTTy, but the same behavior occurs with telnet from WinXP but DOES NOT occur from a telnet session on a RedHat linux box. The output from stty -a is identical from sessions via puTTY and from RH telnet. If I simply type a ^M at the end of a line, or a ^J at the end of the line, there's no extra prompt. So it seems to me that my <Enter> key must be causing puTTY and the stock WinXP telnet to send both CR and LF -- I just can't find a setting to stop it.

Is this something simple that I'm just overlooking?

-M.

eastwind
07-10-2005, 11:52 PM
I have what I suspect is a simple question, but I've not been able to find an answer (probably because I just can't find the right search keywords). If anybody can help me, I'd appreciate it.

I've just finished hacking my HR10-250 and all looks good -- with one very minor annoyance. Every time I press the 'Enter' key at the end of a bash prompt during a telnet session, I get an extra LF. The symptom is that I always get a double bash prompt. For example, if I type:

bash-2.02# ls <Enter>
filename1 filename2 filename3
bash-2.02#
bash-2.02#

The shell is clearly seeing an extra CR or LF, but I don't know how to correct this. I thought it might be an artifact of puTTy, but the same behavior occurs with telnet from WinXP but DOES NOT occur from a telnet session on a RedHat linux box. The output from stty -a is identical from sessions via puTTY and from RH telnet. If I simply type a ^M at the end of a line, or a ^J at the end of the line, there's no extra prompt. So it seems to me that my <Enter> key must be causing puTTY and the stock WinXP telnet to send both CR and LF -- I just can't find a setting to stop it.

Is this something simple that I'm just overlooking?

-M.In Microsoft Telnet you can start the session without connecting: telnet. Then use a '?' to find the options.

I don't use puTTY, so I can't help you there, except to say there will be a similar way to fix the problem in both.

ew

bgreen
07-11-2005, 12:18 AM
For WinXP, do the following to set up telnet correctly...

telnet
unset crlf
exit

Future telnet sessions will honor these settings.

dave4089
07-11-2005, 09:41 AM
In the putty configuration screen, go to the Connection/Telnet settings. The last check box says "Return key sends telnet New Line instead of ^M". Uncheck this box and your problem should go away.

Dave

markhargrove
07-11-2005, 08:04 PM
Thanks everybody! Suggestions for both XP telnet as well as puTTY worked exactly as indicated. I don't know how the heck I missed the setting in puTTY -- I thought I'd visited every single menu!

-M.

dcom
10-06-2008, 06:34 PM
Also, in Terminal/Line discipline options set Local line editing to Force off