From 21e2b39fa81e21144ef6100164a4333c3f5aec4e Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 19 Nov 2020 19:15:37 -0800 Subject: [PATCH] Add a sleep to bind.py With the upcoming fix to place the tty in external-proc mode, add a sleep which resolves a race between emitting a newline and restoring it to shell mode. --- tests/pexpects/bind.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pexpects/bind.py b/tests/pexpects/bind.py index a9e3a874c..64779447c 100644 --- a/tests/pexpects/bind.py +++ b/tests/pexpects/bind.py @@ -283,6 +283,11 @@ expect_prompt("git@", unmatched="ctrl-w does not stop at @") send("bind -k nul 'echo nul seen'\r") expect_prompt() send("\0" * 3) +# We need to sleep briefly before emitting a newline, because when we execute the +# key bindings above we place the tty in external-proc mode (see #7483) and restoring +# the mode to shell-mode races with the newline emitted below (i.e. sometimes it may +# be echoed). +sleep(0.1) send("\r") expect_prompt("nul seen\r\nnul seen\r\nnul seen", unmatched="nul not seen")