mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 22:44:01 +00:00
Unconditionally set the tty mode in reader_readline
There was a bogus check for is_interactive_session. But if we are in reader_readline we are necessarily interactive (even if we are not in an interactive session, i.e. a fish script invoked some interactive functionality). Remove this check. Fixes #5519
This commit is contained in:
parent
1d21e3f470
commit
364c839279
1 changed files with 3 additions and 5 deletions
|
@ -2474,11 +2474,9 @@ const wchar_t *reader_readline(int nchars) {
|
||||||
// Get the current terminal modes. These will be restored when the function returns.
|
// Get the current terminal modes. These will be restored when the function returns.
|
||||||
if (tcgetattr(STDIN_FILENO, &old_modes) == -1 && errno == EIO) redirect_tty_output();
|
if (tcgetattr(STDIN_FILENO, &old_modes) == -1 && errno == EIO) redirect_tty_output();
|
||||||
// Set the new modes.
|
// Set the new modes.
|
||||||
if (is_interactive_session) {
|
if (tcsetattr(0, TCSANOW, &shell_modes) == -1) {
|
||||||
if (tcsetattr(0, TCSANOW, &shell_modes) == -1) {
|
if (errno == EIO) redirect_tty_output();
|
||||||
if (errno == EIO) redirect_tty_output();
|
wperror(L"tcsetattr");
|
||||||
wperror(L"tcsetattr");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!finished && !data->end_loop) {
|
while (!finished && !data->end_loop) {
|
||||||
|
|
Loading…
Reference in a new issue