From 57830266e40679895c0998565a241c3ad8aeab9e Mon Sep 17 00:00:00 2001 From: Bjoern Hiller Date: Tue, 1 Nov 2022 17:03:15 +0100 Subject: [PATCH 1/2] fix(test_capture_pane): use of double `env` This makes the test fail (at least for me) as it still won't start bash but my login-shell (which is not bash). --- tests/test_pane.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_pane.py b/tests/test_pane.py index ef33cca48..58def41f5 100644 --- a/tests/test_pane.py +++ b/tests/test_pane.py @@ -1,5 +1,6 @@ """Tests for libtmux Pane object.""" import logging +import shutil from libtmux.session import Session @@ -66,10 +67,13 @@ def test_set_width(session: Session) -> None: def test_capture_pane(session: Session) -> None: + env = shutil.which("env") + assert env is not None, "Cannot find usable `env` in PATH." + session.new_window( attach=True, window_name="capture_pane", - window_shell='env -i PS1="$ " /usr/bin/env bash --norc --noprofile', + window_shell=f"{env} PS1='$ ' bash --norc --noprofile", ) pane = session.attached_window.attached_pane assert pane is not None From b74e428d594cd83e010024926879f64d7101948e Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 5 Nov 2022 08:51:31 -0500 Subject: [PATCH 2/2] docs(CHANGES): Note test_capture_pane improvement --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 5392ccb0e..9aa68ecb6 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,11 @@ $ pip install --user --upgrade --pre libtmux +### Tests + +- Compatibility improvement for `test_capture_pane` and `env` (#452), credit: + @zappolowski! + ## libtmux 0.15.9 (2022-10-30) ### Bug fix