tmuxp.workspace.options.resolve_session_shell
-
Resolve the effective interactive shell for a tmux session.
Description#
Prefers tmux's
default-shelloption (which reflects a workspace'soptions.default-shellonce applied, otherwise tmux's global default), and falls back to theSHELLenvironment variable.Examples#
>>> class FakeSession:... def __init__(self, shell):... self._shell = shell... def show_option(self, name, **kwargs):... return self._shellThe tmux
default-shellwins when set:>>> resolve_session_shell(FakeSession("/usr/bin/zsh"), env={})'/usr/bin/zsh'The
SHELLenv var is the fallback:>>> resolve_session_shell(FakeSession(None), env={"SHELL": "/bin/bash"})'/bin/bash'