Question

description of what's happening:

  • when minimizing a maximized pane, this message appears at bottom of terminal window: "Session not found: tmp"
  • pane appears to return to same place as initial/previous session
  • but the new tmp window (that was opened when the pane was first maximized) fails to close and appears in the list of windows (in the status bar at the bottom of tmux)

my hunch is kill-window -t tmp (in the below .tmux.conf code) is where things break. since executing a command in the tmp window appears to rename the window, kill-window -t tmp won't work.

so my question is: how could i alter .tmux.conf to prevent this from happening?

steps to recreate bug:

(note: you would need to have modified .tmux.conf for these commands to work)

  • start tmux and create session w/ at least two panes
  • maximize one pane using [prefix] + [up]
  • execute a shell command in maximized pane (*)
  • minimize pane using [prefix] + [down]

(*) if pane is maximized and minimized w/out executing a command in the shell this problem does not appear to occur. i.e. if you're editing a file in a pane, then maximize that pane, and only edit/save the file (w/out exiting and then executing another command), then minimize -- the bug doesn't occur.

30s youtube clip showing what happens: http://youtu.be/WMdOeJdOYuU

code that might be causing the error (from ~/.tmux.conf):

unbind Up bind Up new-window -d -n tmp \; swap-pane -s tmp.0 \; select-window -t tmp unbind Down bind Down last-window \; swap-pane -s tmp.0 \; kill-window -t tmp

[edit: HERE IS THE SOLUTION]

thanks to a helpful #tmux irc'er (who has this link and whom i will happily give credit) this question is solved. i don't yet have enough cred to answer this question so i'm posting the solution here.

the solution is to add set-window-option -g allow-rename off to ~/.tmux.conf

this works b/c tmp doesn't get renamed so kill-window -t tmp can properly execute.

(thx for the help and feel free to answer this so i can give you credit!)

Was it helpful?

Solution

You want allow-rename set to off, at least for that one window:

set-window-option -g allow-rename off
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top