diff options
author | Stefan Eßer <se@FreeBSD.org> | 2021-09-22 17:26:08 +0200 |
---|---|---|
committer | Stefan Eßer <se@FreeBSD.org> | 2021-09-22 17:26:08 +0200 |
commit | 242c367ad64b275e372a66e1e6831b54905b60d8 (patch) | |
tree | c23065d36178716c4746fc476685b5ab0cab5594 | |
parent | b717990ac74691f2081f4ab0c63d8829db9e8fa1 (diff) | |
download | pexpect-242c367ad64b275e372a66e1e6831b54905b60d8.tar.gz |
Disable baacketed-paste mode in bash 5.1 and newer (issue #669)
The bash versions starting with 5.1 have bracketed paste mode enabled
by default, leading to test failures in replwrap.bash(), e.g.:
self = <tests.test_replwrap.REPLWrapTestCase testMethod=test_multiline>
def test_multiline(self):
bash = replwrap.bash()
res = bash.run_command("echo '1 2\n3 4'")
> self.assertEqual(res.strip().splitlines(), ['1 2', '3 4'])
E AssertionError: Lists differ: ['\x1b[?2004l', '\x1b[?2004h\x1b[?2004l',
'1 2', '3 4', '\x1b[?2004h'] != ['1 2', '3 4']
E
E First differing element 0:
E '\x1b[?2004l'
E '1 2'
E
E First list contains 3 additional elements.
E First extra element 2:
E '1 2'
E
E - ['\x1b[?2004l', '\x1b[?2004h\x1b[?2004l', '1 2', '3 4', '\x1b[?2004h']
E + ['1 2', '3 4']
With bracketed test mode disabled, the tests that were affected by the
inserted escape sequences succeed.
-rw-r--r-- | pexpect/bashrc.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pexpect/bashrc.sh b/pexpect/bashrc.sh index c734ac9..d75d1a5 100644 --- a/pexpect/bashrc.sh +++ b/pexpect/bashrc.sh @@ -14,3 +14,5 @@ PS1="$" # Unset PROMPT_COMMAND, so that it can't change PS1 to something unexpected. unset PROMPT_COMMAND + +bind 'set enable-bracketed-paste off' |