Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: strange xterm & zsh behaviour



Bart Schaefer wrote:
> On Jan 27, 11:26pm, Drazen Kacar wrote:
> } Subject: strange xterm  & zsh behaviour
> }
> } I've noticed that zsh in xterm behaves very strange when I'm in OpenWindows
> } or failsafe session.
> 
> It would help to know which version of zsh.  3.0.5?

Yes. I'm sorry I didn't include more details. I started writing complaint
about xterm on comp.unix.solaris and then I checked ksh, just to see how
it fails in the same way. But it didn't, so I checked the rest of the
shells and then had to send a copy to zsh the mailing list. I was too much
surprised to think.

Here are the details (some of which are not needed):
I'm using a box which has "Ultra 1 creator" written on it, with Solaris
7 in 64-bit environment. It's freshly installed and software that's not
from Sun's CDs is either compiled by me or by one of my co-workers.
We use Debian packaging system and run-away config files are out of
the question. This also means that all of our packages are compiled
on Solaris 2.6 in 32-bit environment.

However, I've seen the same problem on Solaris 2.6 on consoles and
some terribly old Sun's X terminals. I don't know what exactly runs
on those terminals, but I'm pretty sure it all comes from Sun.

Since I'm trying to bring this station into usable state (that is,
get rid of the CDE), I'm currently in a failsafe session which gives
me one dtterm (/usr/dt/bin/dtterm). All reports are about xterm
(/usr/openwin/bin/xterm) started from the first dtterm.

> } Control keys and arrow keys don't work any
> } more. The shell just echos ^[[A (for example) instead of scrolling
> } through the history list. Ctrl-C is being echoed as ^C and the shell
> } doesn't prompt in a new line.
> 
> Sounds like something has stomped on the tty driver settings.

Yes, just like I was on a teletype. When I press ctrl-C, the only
visible effect is echoing "^C" in the same line. However, the shell
cancels the command, since pressing enter produces only a prompt in the
next line, regardless of what I previously typed in.

> What do you see if you give the "stty -a" command? 

These are with Sun's stty. I currently don't have GNU stty, but I can install
it if need be.

iispeed 89376 baud; ospeed 89360 baud; 
rows = 24; columns = 80; ypixels = 364; xpixels = 724;
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^h; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb parodd cs8 cstopb hupcl cread -clocal loblk crtscts crtsxoff parext 
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc 
ixon -ixany ixoff -imaxbel 
isig icanon -xcase echo echoe echok -echonl noflsh 
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten 
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 

Dtterm has the same values, except for pixel values and erase character :-)

> Is the value of $TERM the correct one?

Set to "vt100" in $HOME/.zshrc. This is an ugly habbit which has something
to do with people who like to define horrors like "xterm-debian" and the
like. Setting TERM to "xterm" doesn't change anything. Vi is usually good at
bringing terminals to the sane state, but not in this case.

> Sun OSs have a nasty habit of copying the console tty settings to all
> newly opened psuedo-tty devices, which is what xterm uses for I/O.  In
> the X11R6 xterm there's even a resource, XTerm*ttyModes, added just to
> address this issue.

And something decided I need it. xrdb -query reports (among lots of trash):

*ttyModes:      erase ^H intr ^C kill ^U start ^Q stop ^S swtch ^@ susp ^Z

Setting swtch to ^@ doesn't change anything.
/usr/dt/app-defaults/C/Dtterm contains only cosmetics. The same is with
/usr/openwin/lib/app-defaults/XTerm.

> Or an appropriate stty command in an init file; ksh, bash, and tcsh may
> even already have such commands in /etc/profile or /etc/cshrc or whatever.

grep stty **/*(.) in /etc and /usr/dt/config doesn't produce a thing
(except stty -istrip somewhere in /etc/skel.orig, but I think this isn't
executed). Neither does "**/.*(.)".

The only global config file is /etc/profile. Csh doesn't have global
config (according to the man page). Other shells do, but the files do
not exist on my system. There are .* init files in my home directory
(created by useradd -m), but none of them contains interesting stuff.

A friend of mine kind of solved the problem 4-5 months ago. Rxvt (the latest
and greatest at the time) behaved just like xterm. When I asked him about
his solution he couldn't remember the exact procedure, so I got something
like "There is a fallback code for terminal settings in rxvt in case
those weren't set by the system. I just removed the if clause and told it
to always set them." Don't ask about details. Your guess is as good as
mine.

I remember I was trying to copy terminal settings from patched rxvt to
xterm (using both Sun's and GNU stty), but to no avail.

That's about it. Further quetions?

-- 
 .-.   .-.    Life is a sexually transmitted disease.
(_  \ /  _)
     |        dave@xxxxxxx
     |        dave@xxxxxxxxxxxxx




Messages sorted by: Reverse Date, Date, Thread, Author