Skip to content

fix(test_capture_pane): use of double env #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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