mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 21:18:53 +00:00
Fix for off by one error with "missing newline" code
This commit is contained in:
parent
f599239fd4
commit
1feea366ca
1 changed files with 2 additions and 2 deletions
|
@ -1338,12 +1338,12 @@ void s_reset(screen_t *s, screen_reset_mode_t mode)
|
||||||
abandon_line_string.reserve(screen_width);
|
abandon_line_string.reserve(screen_width);
|
||||||
|
|
||||||
int non_space_width = wcwidth(omitted_newline_char);
|
int non_space_width = wcwidth(omitted_newline_char);
|
||||||
if (screen_width > non_space_width)
|
if (screen_width >= non_space_width)
|
||||||
{
|
{
|
||||||
abandon_line_string.append(L"\x1b[7m"); //invert text ANSI escape sequence
|
abandon_line_string.append(L"\x1b[7m"); //invert text ANSI escape sequence
|
||||||
abandon_line_string.push_back(omitted_newline_char);
|
abandon_line_string.push_back(omitted_newline_char);
|
||||||
abandon_line_string.append(L"\x1b[0m"); //normal text ANSI escape sequence
|
abandon_line_string.append(L"\x1b[0m"); //normal text ANSI escape sequence
|
||||||
abandon_line_string.append(screen_width - non_space_width - 1, L' ');
|
abandon_line_string.append(screen_width - non_space_width, L' ');
|
||||||
}
|
}
|
||||||
abandon_line_string.push_back(L'\r');
|
abandon_line_string.push_back(L'\r');
|
||||||
const std::string narrow_abandon_line_string = wcs2string(abandon_line_string);
|
const std::string narrow_abandon_line_string = wcs2string(abandon_line_string);
|
||||||
|
|
Loading…
Reference in a new issue