You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Server#list_windows and #list_panes raise on a server with no session #119
On a server with no session, Server#list_sessions returns [] and Server#snapshot returns an empty snapshot, but Server#list_windows and Server#list_panes raise LibTmux::CommandError. tmux answers no current target because list-windows -a and list-panes -a need a default target when no session exists. A caller that loops over all panes, as the root README's async example does with scope.server.list_panes, crashes instead of seeing an empty list.
list_windows and list_panes return an empty frozen array, as list_sessions does.
Actual
list_sessions prints [] and snapshot.panes.length prints 0, then list_windows raises:
LibTmux::CommandError: tmux command failed
stderr: "no current target\n"
Server#list_panes raises the same way.
Environment
Versions
libtmux at commit 5dc3761, Ruby 4.0.7, tmux 3.8a, Linux (WSL2)
Evidence
Internal::Capture#acquire_rows already knows this: its comment says the window and pane list commands "require a default target" and returns an empty root when list-sessions is empty. Server#list_entities has no such guard, and list_windows and list_panes reach it with -a.
Proposal
Apply the snapshot's rule in list_entities: when the global listing fails and a list-sessions read on the same server is empty, return []; any other failure still raises. Add a test on a started server with no session.
Activity