mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 23:02:44 +08:00
webconfig: Allow \co sgr0 in one more place
Some $TERMs like tmux and linux use an sgr0 ("reset") value that ends in \co instead of "m". We need to adjust our regex here to catch that, or we'd miscount lines with it.
This commit is contained in:
parent
d7dac4d077
commit
c9fe59237b
|
@ -290,9 +290,9 @@ def append_html_for_ansi_escape(full_val, result, span_open):
|
|||
|
||||
def strip_ansi(val):
|
||||
# Make a half-assed effort to strip ANSI control sequences
|
||||
# We assume that all such sequences start with 0x1b and end with m,
|
||||
# We assume that all such sequences start with 0x1b and end with m or ctrl-o,
|
||||
# which catches most cases
|
||||
return re.sub("\x1b[^m]*m", '', val)
|
||||
return re.sub("\x1b[^m]*m\x0f?", '', val)
|
||||
|
||||
|
||||
def ansi_prompt_line_width(val):
|
||||
|
|
Loading…
Reference in New Issue
Block a user