# tmuxp.workspace.options.resolve_session_shell

- **Module:** tmuxp.workspace.options
- **Package:** tmuxp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/tmuxp/blob/153acdf6ff1268b14d3d03ed488f545a7123c8f1/src/tmuxp/workspace/options.py#L184
- **Page:** https://libtmux.org/en/py/latest/workspace/reference/tmuxp-workspace-options-resolve_session_shell/

```
tmuxp.workspace.options.resolve_session_shell(session: t.Any, env: t.Mapping[str, str] | None = None) -> str
```

Resolve the effective interactive shell for a tmux session.

Prefers tmux's ``default-shell`` option (which reflects a workspace's
``options.default-shell`` once applied, otherwise tmux's global default),
and falls back to the ``SHELL`` environment variable.

## Parameters

- `session` (t.Any): live session exposing ``show_option("default-shell")``
- `env` (t.Mapping[str, str] | None): environment mapping for the ``SHELL`` fallback; defaults to
:data:`os.environ`

## Returns

str
    resolved shell path/name, or ``""`` when undeterminable

## Example

```python
>>> class FakeSession:
...     def __init__(self, shell):
...         self._shell = shell
...     def show_option(self, name, **kwargs):
...         return self._shell
```

## Example

The tmux ``default-shell`` wins when set:

```python
>>> resolve_session_shell(FakeSession("/usr/bin/zsh"), env={})
'/usr/bin/zsh'
```

## Example

The ``SHELL`` env var is the fallback:

```python
>>> resolve_session_shell(FakeSession(None), env={"SHELL": "/bin/bash"})
'/bin/bash'
```
