Skip to content

Commit b2ed108

Browse files
authored
fix(test_capture_pane): Improve compatibility of env(1) (#452)
2 parents 3c71322 + b74e428 commit b2ed108

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGES

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ $ pip install --user --upgrade --pre libtmux
1414

1515
<!-- Maintainers and contributors: Insert change notes for the next release above -->
1616

17+
### Tests
18+
19+
- Compatibility improvement for `test_capture_pane` and `env` (#452), credit:
20+
@zappolowski!
21+
1722
## libtmux 0.15.9 (2022-10-30)
1823

1924
### Bug fix

tests/test_pane.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for libtmux Pane object."""
22
import logging
3+
import shutil
34

45
from libtmux.session import Session
56

@@ -66,10 +67,13 @@ def test_set_width(session: Session) -> None:
6667

6768

6869
def test_capture_pane(session: Session) -> None:
70+
env = shutil.which("env")
71+
assert env is not None, "Cannot find usable `env` in PATH."
72+
6973
session.new_window(
7074
attach=True,
7175
window_name="capture_pane",
72-
window_shell='env -i PS1="$ " /usr/bin/env bash --norc --noprofile',
76+
window_shell=f"{env} PS1='$ ' bash --norc --noprofile",
7377
)
7478
pane = session.attached_window.attached_pane
7579
assert pane is not None

0 commit comments

Comments
 (0)