Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zsh 4.3.9: Interrupted "tcsetattr" call problem, tiling-wm related
- X-seq: zsh-workers 26625
- From: Lionel Flandrin <lionel@xxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: zsh 4.3.9: Interrupted "tcsetattr" call problem, tiling-wm related
- Date: Fri, 27 Feb 2009 17:20:25 +0100
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hi everybody, I haven't subscribed to this list so please include me
in Cc in your replies.
I think I have spotted a bug related to this one:
http://www.zsh.org/mla/workers/2007/msg01121.html
Basically, *sometimes* I get an unusable prompt when I start a new
terminal, if I type <TAB> I get a litteral tab, if I type "key up" I
get ^[[A etc...
A strace told me the problem is that the terminal bufferizes the
output line by line, i.e. is in ICANON termios mode.
A couple of grep and dirty fprintf in the source code later, I think
I've found the root of the problem at Src/utils.c line 1440:
1440 tcsetattr(SHTTY, TCSADRAIN, &ti->tio);
1441 /* if (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1) */
(It's interresting that the bugfix is almost already there :).
Indeed, the problem seems to be that I use a tiling WM (stumpwm) that
resizes the term as soon as it's created, sending (I'm just guessing
there) the SIGWINCH signal to zsh interrupting the tcsetattr.
If I add some debug code:
while (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1)
{
FILE *f = fopen("/tmp/fail.out", "a");
fprintf(f, "tcsetattr failed: %s\n", strerror(errno));
fclose(f);
}
I do get: "tcsetattr failed: Interrupted system call"
If I change the call to:
while (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1 && errno == EINTR);
It fixes the problem.
I hope this helps.
(Thank to ft on freenode's #zsh for his help).
--
Lionel Flandrin
Messages sorted by:
Reverse Date,
Date,
Thread,
Author