Don't overwrite IXON/IXOFF for startup modes

We actually restore those before exit, so this would force-disable
flow control whenever fish exits.
This commit is contained in:
Fabian Homborg 2021-02-11 21:17:24 +01:00
parent 1426d61bc9
commit c83436d050

View File

@ -1319,10 +1319,6 @@ void reader_init() {
// Save the initial terminal mode.
tcgetattr(STDIN_FILENO, &terminal_mode_on_startup);
// Disable flow control by default.
terminal_mode_on_startup.c_iflag &= ~IXON;
terminal_mode_on_startup.c_iflag &= ~IXOFF;
// Set the mode used for program execution, initialized to the current mode.
std::memcpy(&tty_modes_for_external_cmds, &terminal_mode_on_startup,
sizeof tty_modes_for_external_cmds);
@ -1331,6 +1327,12 @@ void reader_init() {
// Set the mode used for the terminal, initialized to the current mode.
std::memcpy(&shell_modes, &terminal_mode_on_startup, sizeof shell_modes);
// Disable flow control by default.
tty_modes_for_external_cmds.c_iflag &= ~IXON;
tty_modes_for_external_cmds.c_iflag &= ~IXOFF;
shell_modes.c_iflag &= ~IXON;
shell_modes.c_iflag &= ~IXOFF;
term_fix_modes(&shell_modes);
// We do this not because we actually need the window size but for its side-effect of correctly