Skip to content

Commit

Permalink
fix(test_capture_pane): Improve compatibility of env(1) (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony authored Nov 5, 2022
2 parents 3c71322 + b74e428 commit b2ed108
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ $ pip install --user --upgrade --pre libtmux

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

### Tests

- Compatibility improvement for `test_capture_pane` and `env` (#452), credit:
@zappolowski!

## libtmux 0.15.9 (2022-10-30)

### Bug fix
Expand Down
6 changes: 5 additions & 1 deletion tests/test_pane.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for libtmux Pane object."""
import logging
import shutil

from libtmux.session import Session

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b2ed108

Please sign in to comment.