mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 08:51:14 -03:00
Since commit7e3fac561d(Query terminal only just before reading from it, 2025-09-25), fish -c 'read; cat' fails to turn ICANON back on for cat. Even before that commit, I don't know how this ever worked. Before or after, we'd call tcsetattr() only to set our shell modes, not the ones for external commands (term_donate) I also don't think there's a good reason why we set modes twice (between term_donate () and old_modes), but I'll make a minimal (= safer) change for now until I understand this. The only change from7e3fac561dwas that instead of doing things in this order: terminal_init() set_shell_modes read reader_push() reader_readline() save & restore old_modes cat we now do read reader_push() terminal_init() set_shell_modes() reader_readline() save & restore old_modes cat So we call set_shell_modes() just before saving modes, which obviously makes us save the wrong thing. Again, not sure how that wasn't a problem before. Fix it by saving modes before calling terminal_init(). Fixes #12024
825 B
825 B