Operating System - HP-UX
1832547 Members
6691 Online
110043 Solutions
New Discussion

Double characters from nowhere

 
Doug Brinkman - DRI CMA
Occasional Advisor

Double characters from nowhere

Hi,

Periodically, for some reason, on a k-class server running 10.20, users will complain that they suddenly begin getting two charaters for every one typed. It doesn't matter if it's an xterm or telnet session. Doesn't matter if it's a terminal emulation program on a PC, or whatever. Rebooting either their PC OR the server clears up the problem.(for a while). I've checked environment variables and stty settings. nothing has changed. Is anyone aware of a patch or something I may be overlooking?

Thanks in advance,
Ed Johnson
9 REPLIES 9
Martin Johnson
Honored Contributor

Re: Double characters from nowhere

Usually when that happens to me it is a telnet session. I do:

^]
telnet> toggle echo

That takes care of the problem.

HTH
Marty
Jeff Schussele
Honored Contributor

Re: Double characters from nowhere

Hi Ed,

Suspect that some script is running the
stty echo
command to echo all chars typed.

This can be confirmed when the next time it happens, have the user run
stty -echo
If it stops *something* had to have turned it on. Then the detective work starts....What did they do just prior to onset?....

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Doug Brinkman - DRI CMA
Occasional Advisor

Re: Double characters from nowhere

Actually, I experimented with stty -echo. This will cause nothing to be echoed to the screen, while stty echo simply causes whatever you type to show up on screen, but not in pairs.

A. Clay Stephenson
Acclaimed Contributor

Re: Double characters from nowhere

Well, stty echo could be getting you in this way. Typically, an application will set the to -echo and do all the echoeing itself after checking the input character for validity. If inside the application, echo mode gets set then you will see this condition. If this is occurring at the shell where normally echo (not -echo) is set then you have a different problem. I suspect that you are sending the escape sequence that puts the terminal in local echo (half-duplex) mode.

The kinds of things that can cause this are abnormal terminations of applications before the terminal can be restored to its original settings.
If it ain't broke, I can fix that.
Doug Brinkman - DRI CMA
Occasional Advisor

Re: Double characters from nowhere

Thanks for the replies. I should point out that this occurs at the shell level. User logs in , and attempts to vi a file, that sort of thing.
Jeff Schussele
Honored Contributor

Re: Double characters from nowhere

AHHH....yes.....half-duplex.
Think Clay nailed it - it's local echoing.
Should've remembered that....but that's why's he got a salad hat....
Yep good ole' abends will leave terminals in oddball states.
If it's at the shell & double-char, then try
stty sane
to get back to normal.
If it's in the app, I'm not sure what you can do - shell-out to reset?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Double characters from nowhere

Well if the users' complain about vi, make sure that their systems are reporting the proper term type.
vi is very sensitive to the proper TERM being set. It sends loads of control characters & set modes all over the place - could be a term type mismatch that blunders into this.

Have them
echo $TERM
when they are having this problem & then determine just what their terminal device is & should be set to & make sure they match.
May need to customize their .profile or do some tset work in there to get their TERM proper @ login.

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Doug Brinkman - DRI CMA
Occasional Advisor

Re: Double characters from nowhere

I should have mentioned that I did try stty sane - didn't work. Seems to be isolated to this particular system as well. (It's one of two identical systems in a serviceguard cluster. My previous background was in serial communications & dumb terminals, etc. (Digi, Comtrol) So I figured I'd have this sussed in no time. *wrong*. I'll probably try doing a tset next time it happens. Thanks again!
Bill Hassell
Honored Contributor

Re: Double characters from nowhere

Actually, double characters are caused by the terminal, not the Unix side. In the good old days, data was sent using the send-and-pray protocol, that is, no idea if anything got through to the server. So Unix (and a few other opsystems) decided to use a remote-echo method to let you know if the cable was connected.

In local echo mode, the terminal keyboard produces text on the screen regardless of whether the cable is connected or not. But in remote echo mode, the keyboard sends the character to the computer and that's all. Then if the computer gets the character and all the software works corerctly, the character will be echoed back to the screen. It looks like you're typing on the screen but really, you are typing to the computer and it in turn puts the characters onto the screen.

The most common problem is with people that cat binary files (which have lots of nasty escape codes) that change terminal settings. It would take a serial analyzer to see if only one character comes back to the terminal.


Bill Hassell, sysadmin