mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-30 17:41:14 -03: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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user