mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 06:17:43 +08:00
Disable ONLCR mapping of NL output to CR-NL
Per @nbuwe's excellent explanation in #4505, we can save on output to the tty by maintaining column location after NL by disabling the ONLCR terminal mode. Closes #4505.
This commit is contained in:
parent
dfe6bc531e
commit
3f820f0edf
|
@ -924,6 +924,7 @@ void reader_init() {
|
|||
shell_modes.c_iflag &= ~INLCR; // disable mapping NL (\cJ) to CR (\cM)
|
||||
shell_modes.c_iflag &= ~IXON; // disable flow control
|
||||
shell_modes.c_iflag &= ~IXOFF; // disable flow control
|
||||
shell_modes.c_iflag &= ~ONLCR; // disable mapping of NL to CR-NL on output (#4505)
|
||||
|
||||
shell_modes.c_lflag &= ~ICANON; // turn off canonical mode
|
||||
shell_modes.c_lflag &= ~ECHO; // turn off echo mode
|
||||
|
|
|
@ -488,13 +488,6 @@ static void s_move(screen_t *s, data_buffer_t *b, int new_x, int new_y) {
|
|||
|
||||
y_steps = new_y - s->actual.cursor.y;
|
||||
|
||||
if (y_steps > 0 && (strcmp(cursor_down, "\n") == 0)) {
|
||||
// This is very strange - it seems some (all?) consoles use a simple newline as the cursor
|
||||
// down escape. This will of course move the cursor to the beginning of the line as well as
|
||||
// moving it down one step. The cursor_up does not have this behaviour...
|
||||
s->actual.cursor.x = 0;
|
||||
}
|
||||
|
||||
if (y_steps < 0) {
|
||||
str = cursor_up;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user