mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 21:43:55 +08:00
pexpect: Consume color sequences in expect_prompt
We typically use TERM=dumb, but in some cases we need actual cursor and color stuff.
This commit is contained in:
parent
51e3258dbe
commit
5478d979a0
|
@ -31,9 +31,13 @@ def get_prompt_re(counter):
|
||||||
""" Return a regular expression for matching a with a given prompt counter. """
|
""" Return a regular expression for matching a with a given prompt counter. """
|
||||||
return re.compile(
|
return re.compile(
|
||||||
r"""(?:\r\n?|^) # beginning of line
|
r"""(?:\r\n?|^) # beginning of line
|
||||||
|
(?:\x1b[\d\[KB(m]*)* # optional colors
|
||||||
(?:\[.\]\ )? # optional vi mode prompt
|
(?:\[.\]\ )? # optional vi mode prompt
|
||||||
"""
|
"""
|
||||||
+ (r"prompt\ %d>" % counter), # prompt with counter
|
+ (r"prompt\ %d>" % counter) # prompt with counter
|
||||||
|
+ r"""
|
||||||
|
(?:\x1b[\d\[KB(m]*)* # optional colors
|
||||||
|
""",
|
||||||
re.VERBOSE,
|
re.VERBOSE,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user