From 965bc78d332c7282d0d8abebd96b656d835d8b11 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 21 Dec 2024 14:21:56 +0100 Subject: [PATCH] Work around weird CI failures due to missing pre-execute \r\n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I forgot that 610338cc70 (On undo after execute, restore the cursor position, 2024-12-21) would cause a fallout to tests: It makes us reuse in another place our usual cursor-movement sequences. This causes failures like this (linebreaks added for readability): Testing file pexpects/bind.py:Failed to match pattern: (?:\r\n|\x1b\[2 q)[^\n]*def abc\r\n bind.py:45: timeout from expect_prompt(TO_END + "def abc\r\n") # emacs transpose words, default timeout: no delay Escaped buffer: \x1b[?2004h\x1b[>4;1m\x1b[=5u\x1b=\rprompt 2>echo \rprompt 2>echo abc \rprompt 2>echo def abc\r prompt 2>echo def abc\x1b[?2004l\x1b[>4;0m\x1b[=0u\x1b>\x1b]133;C\x07def abc\r\n\x1b]133;D;0\x07\x1b[?25h⏎ \r⏎ \r\rprompt 3>\x1b[?2004h\x1b[>4;1m\x1b[=5u\x1b= It seems that we don't print anything where we should print something like "\r\n" or "\e[2 q" to move the cursor below the command line. I haven't gotten to the bottom of this but it might be related to terminfo. Once we get rid of that, we can unconditionally print our canonical movement sequences. This issue seems to only affect tests, since fish operates fine in a sourcehut CI system. Let's ignore it for now. --- build_tools/pexpect_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/pexpect_helper.py b/build_tools/pexpect_helper.py index e8bb143e4..c553efef9 100644 --- a/build_tools/pexpect_helper.py +++ b/build_tools/pexpect_helper.py @@ -130,7 +130,7 @@ class Message(object): return Message(Message.DIR_OUTPUT, text, when) # Sequences for moving the cursor below the commandline. This happens before executing. -MOVE_TO_END: str = r"(?:\r\n|\x1b\[2 q)" +MOVE_TO_END: str = r"(?:\r\n|\x1b\[2 q|)" TO_END: str = MOVE_TO_END + r"[^\n]*" TO_END_SUFFIX: str = r"[^\n]*" + MOVE_TO_END