From 5c014abe3f1e78f49bf959ca366e57ee83fe71fe Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Fri, 2 Aug 2024 10:19:21 +0200 Subject: [PATCH 1/2] Fix ZSH tests when TERM variable is set to linux Running the test-suite with TERM=linux causes the ZSH related tests to fail. Fixed by hardcoding TERM="" when running the ZSH tests. Signed-off-by: Olivier Gayot --- test/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test.py b/test/test.py index 4382faf..b06bfae 100755 --- a/test/test.py +++ b/test/test.py @@ -65,6 +65,7 @@ def run_command(self, command, **kwargs): def _repl_sh(command, args, non_printable_insert): os.environ["PS1"] = "$" + os.environ["TERM"] = "" child = pexpect.spawn(command, args, echo=False, encoding="utf-8") ps1 = PEXPECT_PROMPT[:5] + non_printable_insert + PEXPECT_PROMPT[5:] ps2 = PEXPECT_CONTINUATION_PROMPT[:5] + non_printable_insert + PEXPECT_CONTINUATION_PROMPT[5:] From 0981e747fcf8964d78795d29e429771b4f105735 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Fri, 2 Aug 2024 10:21:47 +0200 Subject: [PATCH 2/2] Also ensure zsh does not load global RC files when running test-suite While bash only has a single option for disabling bashrc loading, ZSH comes with two options: one for $HOME/.zshrc and one for the global zshrc (typically located in /etc). Pass both options to avoid surprises. Signed-off-by: Olivier Gayot --- test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.py b/test/test.py index b06bfae..75da9b8 100755 --- a/test/test.py +++ b/test/test.py @@ -80,7 +80,7 @@ def bash_repl(command="bash"): def zsh_repl(command="zsh"): - sh = _repl_sh(command, ["--no-rcs", "-V"], non_printable_insert="%(!..)") + sh = _repl_sh(command, ["--no-rcs", "--no-globalrcs", "-V"], non_printable_insert="%(!..)") # Require two tabs to print all options (some tests rely on this). sh.run_command("setopt BASH_AUTO_LIST") return sh