mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 14:34:05 +00:00
Disable cursor_down optimization, but fix to check c_oflag, but c_iflag.
The old commit #3f820f0 "Disable ONLCR mapping of NL output to CR-NL" incorrectly used c_iflag instead of c_oflag, and I copied that error in my patch. Fixed that. However, there seems to be other problems trying to use "\x1B[A", which I have not tried to debug, so comment that out. (However, #3f820f0 seems to mostly work if we fix it to use c_oflag.)
This commit is contained in:
parent
50db10a422
commit
4c0a119557
1 changed files with 6 additions and 6 deletions
|
@ -465,17 +465,17 @@ static void s_move(screen_t *s, int new_x, int new_y) {
|
|||
|
||||
if (y_steps < 0) {
|
||||
str = cursor_up;
|
||||
} else {
|
||||
} else if (y_steps > 0) {
|
||||
str = cursor_down;
|
||||
if ((shell_modes.c_iflag & ONLCR) != 0
|
||||
if ((shell_modes.c_oflag & ONLCR) != 0
|
||||
&& std::strcmp(str, "\n") == 0) { // See GitHub issue #4505.
|
||||
// Most consoles use a simple newline as the cursor down escape.
|
||||
// If ONLCR is enabled (which it normally is) this will of course
|
||||
// also move the cursor to the beginning of the line.
|
||||
if (std::strcmp(cursor_up, "\x1B[A") == 0) // If VT-style terminal
|
||||
str = "\x1B[B"; // ... use real cursor-down
|
||||
else
|
||||
s->actual.cursor.x = 0;
|
||||
// We could do:
|
||||
// if (std::strcmp(cursor_up, "\x1B[A") == 0) str = "\x1B[B";
|
||||
// else ... but that doesn't work for unknown reasons.
|
||||
s->actual.cursor.x = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue