Open cakebaker opened 1 year ago
Can confirm that this is happening. Another strange thing happens too: when I hit ^C
, it gives me 2 empty lines between prompts:
# before tail tests
[terts@deskspacex coreutils]$ ^C
[terts@deskspacex coreutils]$
# after tail tests
[terts@deskspacex coreutils]$ ^C
[terts@deskspacex coreutils]$
With fish
, it all works fine. It also works fine with nextest
in bash
if you want a quick workaround.
Unrelated: These tests take a long time! I don't think we should have any tests that take longer than a second. nextest is reporting up to 12 seconds for some of them.
This SO answer has a reasonable hypothesis: https://askubuntu.com/a/172747
After running the tail tests stty -a
is indeed showing -echo
.
The offending commit based on git bisect
seems to be: https://github.com/uutils/coreutils/commit/1725151ef827f07009c844bbda5ba6de7ab069d9
Update: the test that's causing this is test_follow_with_pid
. It even has a comment describing that: " This test also breaks tty settings under bash requiring a 'stty sane' or reset."
Update 2: I have no idea why it does that but I don't have time to investigate further. I suggest we just turn that test off for now.
It also works on zsh, it seems to be specifically bash
After some testing dummy.kill().unwrap();
is definitively the culprit. Killing sh
manually with exit instead of sending SIGKILL works fine.
Tbf I don't know what the test does but maybe the kill method could be replaced by sending a more gentle signal. SIGTERM and SIGQUIT didn't work but somehow SIGUSR1 make sh
quit gracefully and bash stty is normal after the test.
// This doesn't work :
// dummy.kill().unwrap();
// This does :
kill(Pid::from_raw(pid as i32), Signal::SIGUSR1).unwrap();
let _ = dummy.wait();
Edit : SIGHUP also works
After running the
tail
tests withthe console no longer shows what I type (I'm using bash in KDE's Konsole).