mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 17:26:13 +08:00
Ignore second escape inside an escape code
This commit is contained in:
parent
ca551fdeb9
commit
a05fc52fc8
|
@ -221,8 +221,13 @@ static size_t width_without_escapes(wcstring ins) {
|
|||
auto w = fish_wcwidth(c);
|
||||
if (w > 0) width -= w;
|
||||
}
|
||||
// Move us forward behind the escape code,
|
||||
// it might include a second escape!
|
||||
// E.g. SGR0 ("reset") is \e\(B\e\[m in xterm.
|
||||
pos += *len - 1;
|
||||
} else {
|
||||
pos++;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user