Steffen Nurpmeso dixit:
>just a note that i do use mksh, still, everywhere, but got in
>distress this Monday after it failed again to restore the terminal
>after ^Zuspension. (That is, it fails quite often with a very
>usual use case of mine, git(1) log over $PAGER, but this Monday
Hm, is that the problem that, when you press ^Z, you don’t
get a prompt and can’t really input?
That still happens occasionally for me, very rare, maybe once
a month, and never reproducible :( but usually, when I then
press Enter, or at least fg Enter ^Z, things work again.
>done that in the past already) and can assure you (i.e., too) that
>any termios flag/setting and process group activity and code flow
>in general is absolutely identical in between ^Z properly restores
>the terminal, prints the prompt and allows canonical input ("with
Hm, okay.
>ISIG"), and the other case. I still suspect something about
>process group handling and i guess TTOU relationship, because the
>prompt will always be written and everything is fine, but in the
>latter case you just won't see it.
So this is some kind of race condition?
Is there a part of the stopped processes (git, less, …?) still
running and doing things to the tty?
> ?0[steffen@wales mksh.git]$ SHF PRINT TO FD 2 tty_fd 10 <>
> ^G
>
>Ok you see it but this is of course because the prints to stderr
Oh, interesting too…
>bring it with them. Interesting that the job status (e.g., [1]
>+ Stopped man termios) still gets through, but the
>prompt thereafter isn't.
That’s fun. Do note that edit.c also does termios stuff…
>And, is it a problem with my terminal in the end. But you seem to
>know about this particular problem, too.
Which terminal is that? Also, how good can you reproduce the problem?
Just to isolate: if you can reproduce it, can you do that in a
clean/empty environment (i.e. no profile/mkshrc loaded, maybe as
in 'env -i PATH=$PATH ENV=/nonexistent mksh' (no ‘-l’)?
>Sorry, i really would rather have sent a patch instead!
Thanks for these warm words, it’s always nice to have users
who are helping with fixing problems. I wish I had a better
news for you than “currently, no idea” and the few random
points I made above.
Other than that, if anyone else has an idea, or knows someone
whom we could ask to help debug this (knowledge of Unix signal
and tty handling), please speak up!
Thanks,
//mirabilos
--
“It is inappropriate to require that a time represented as
seconds since the Epoch precisely represent the number of
seconds between the referenced time and the Epoch.”
-- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2