diff --git a/CHANGES b/CHANGES index 8a54b45431..6fc7f773ab 100644 --- a/CHANGES +++ b/CHANGES @@ -56,6 +56,16 @@ _Notes on the upcoming release will go here._ via `gp-furo-theme`, a Tailwind v4 respin of Furo, with `sphinx-vite-builder` handling theme-asset builds (#1037) +### Development + +#### Test panes spawn `/bin/sh` instead of the developer's `$SHELL` (#1041) + +An autouse pytest fixture pins `$SHELL=/bin/sh` so test panes skip +the contributor's interactive shell init. On systems with slow shell +startup (zsh + oh-my-zsh, heavy bash profiles) this can roughly halve +`uv run py.test` wall time; smaller gain on stripped-down shells. No +effect on tmuxp's runtime behavior. + ## tmuxp 1.67.0 (2026-03-08) diff --git a/conftest.py b/conftest.py index 5ae04a57a3..1f0583439e 100644 --- a/conftest.py +++ b/conftest.py @@ -30,6 +30,20 @@ USING_ZSH = "zsh" in os.getenv("SHELL", "") +@pytest.fixture(autouse=True) +def _pin_test_shell_env(monkeypatch: pytest.MonkeyPatch) -> None: + """Pin ``$SHELL`` to ``/bin/sh`` for every test. + + tmux falls back to ``$SHELL`` for new panes when ``default-shell`` is + unset, so pinning the env var here forces every test pane to spawn + ``/bin/sh`` instead of the contributor's interactive shell. Eliminates + rcfile init cost (zsh / oh-my-zsh / bash profile chains) and yields + deterministic prompt output that doesn't flake capture-pane assertions. + ``monkeypatch`` restores the prior value at teardown. + """ + monkeypatch.setenv("SHELL", "/bin/sh") + + @pytest.fixture(autouse=USING_ZSH, scope="session") def zshrc(user_path: pathlib.Path) -> pathlib.Path | None: """Quiets ZSH default message.