Skip to content

Commit 2295b53

Browse files
zappolowskitony
authored andcommitted
fixup! feat(Session.new_window): set up environment
1 parent 3ce74aa commit 2295b53

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_session.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test for libtmux Session object."""
22
import logging
3+
import shutil
34
import typing as t
45

56
import pytest
@@ -260,10 +261,13 @@ def test_cmd_inserts_sesion_id(session: Session) -> None:
260261

261262

262263
def test_new_window_with_environment(session: Session) -> None:
264+
env = shutil.which("env")
265+
assert env is not None, "Cannot find usable `env` in PATH."
266+
263267
window = session.new_window(
264268
attach=True,
265269
window_name="window_with_environment",
266-
window_shell="/usr/bin/env PS1='$ ' bash --norc --noprofile",
270+
window_shell=f"{env} PS1='$ ' bash --norc --noprofile",
267271
environment={"ENV_VAR": "window"},
268272
)
269273
pane = window.attached_pane

0 commit comments

Comments
 (0)