mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Clear to eol before outputting line in multi-line prompt
If the user has a multi-line prompt, we will emit a clr_eol on every line except the last (see #7404). Prior to this change we would emit clr_eol after the line, but in some terminals, if the line extended the width of the tty, the last character would be deleted. Switch to emitting clr_eol first; now the last character will not be cut off. Fixes #8002
This commit is contained in:
parent
c0b33774ca
commit
d3ceba107e
1 changed files with 1 additions and 1 deletions
|
@ -739,10 +739,10 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
|
|||
s_move(scr, 0, 0);
|
||||
size_t start = 0;
|
||||
for (const size_t line_break : left_prompt_layout.line_breaks) {
|
||||
s_write_str(scr, left_prompt.substr(start, line_break - start).c_str());
|
||||
if (clr_eol) {
|
||||
s_write_mbs(scr, clr_eol);
|
||||
}
|
||||
s_write_str(scr, left_prompt.substr(start, line_break - start).c_str());
|
||||
start = line_break;
|
||||
}
|
||||
s_write_str(scr, left_prompt.c_str() + start);
|
||||
|
|
Loading…
Reference in a new issue