Summary
psmux currently allows users to start a new psmux session from within an active psmux session shell. This lack of nesting prevention leads to UI confusion.
Environment
OS: Windows 11 25H2 version 26200.7922
Terminal: Windows Terminal / Alacritty / Wezterm
Shell: PowerShell 7.5.4 / msys2 bash / nushell / busybox ash
psmux: release 0.4.5 install by scoop
What I expected
psmux should detect if it is already running in the current shell environment. If an active session is detected, it should prevent the launch of a nested session by default or provide a warning to the user.
What happened
Running the psmux command inside an existing session successfully spawns a new instance within the current window. Then that session cannot use shortcut, session program cannot exit.
Reproduction
- Open a Windows terminal.
- Start psmux:
psmux
- Inside the psmux session, run
psmux again. Note that a second session starts inside the first one.
Suggested Fix (Reference to tmux)
A proven solution, as seen in tmux, is to export a unique environment variable $TMUX upon session initialization.
The logic would be:
- When psmux starts, it checks for the existence of an environment variable like
PSMUX.
- If the variable exists, the application exits with an error message:
sessions should not be nested.
- If it does not exist, the application sets
$PSMUX and proceeds to launch.
Impact
- Usability: Conflicting keybindings between nested layers.
- UI: Overlapping status bars or screen corruption.
Summary
psmux currently allows users to start a new psmux session from within an active psmux session shell. This lack of nesting prevention leads to UI confusion.
Environment
OS: Windows 11 25H2 version 26200.7922
Terminal: Windows Terminal / Alacritty / Wezterm
Shell: PowerShell 7.5.4 / msys2 bash / nushell / busybox ash
psmux: release 0.4.5 install by scoop
What I expected
psmux should detect if it is already running in the current shell environment. If an active session is detected, it should prevent the launch of a nested session by default or provide a warning to the user.
What happened
Running the
psmuxcommand inside an existing session successfully spawns a new instance within the current window. Then that session cannot use shortcut, session program cannot exit.Reproduction
psmuxpsmuxagain. Note that a second session starts inside the first one.Suggested Fix (Reference to tmux)
A proven solution, as seen in tmux, is to export a unique environment variable
$TMUXupon session initialization.The logic would be:
PSMUX.sessions should not be nested.$PSMUXand proceeds to launch.Impact