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:
ridiculousfish 2019-01-20 17:36:31 -08:00
parent 1680b741b2
commit 3cc581fbb0

View File

@ -2491,12 +2491,10 @@ const wchar_t *reader_readline(int nchars) {
// 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();
// Set the new modes.
if (is_interactive_session) {
if (tcsetattr(0, TCSANOW, &shell_modes) == -1) {
if (errno == EIO) redirect_tty_output();
wperror(L"tcsetattr");
}
}
while (!finished && !data->end_loop) {
if (0 < nchars && (size_t)nchars <= data->command_line.size()) {