I usually use two tmux sessions that share a single window group.
My problem is that panes remember the session they were created from, and a tmux command executed in a shell always acts on the parent session of the pane.

$ tmux new-session -s s1           # the pane is created here
$ tmux new-session -s s2 -t s1

$ tmux display-message -p '#S'     # executed in s2 but prints out s1
$ tmux set status off              # executed in s2 but hides the status bar in s1

A command run in a pane created in s2 would always act on s2.
Direct commands (i.e. :set status off) work as expected.

Is there any simple way (without somehow reassigning the pane) to make a command operate on the current session?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.