Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tmux: hangs after run-shell command and do not respond to any command

Tags:

tmux

I have problem with bindings in tmux 1.8.

Problem appear when I type command which run shell For example:

bind y run-shell "tmux show-buffer | xclip -sel clip -i"

And i type y After execution command, tmux not respond on any other bindings (for example w) It may take a few minutes and then you can use bindings.

what could be the problem? It appeared in version 1.8 (with version 1.7 all ok) OS Ubuntu 13.04(64)

like image 673
maksimr Avatar asked Nov 23 '13 02:11

maksimr


People also ask

How do I exit tmux shell?

You can also exit tmux by pressing : to go to the bottom bar of the tmux window. Then type kill-session. Note that the session will be gone and will not be reattachable. If you want to detach a session instead of simply closing it, use Ctrl-b d (d for "detach").

How do you exit tmux and leave it running?

To detach (meaning exit the window to come back to later) from the tmux session, use CTRL + b then d (hold ctrl, press b, let go of both of the keys, and press d). Whatever program(s) you are running in the tmux session will continue going without you.

How do I exit tmux without closing sessions?

First press CTRL + b the press d . This detaches your session. You then press CTRL + d to log out of ssh. Your detached session still keeps running on the server.

How do I enable tmux in terminal?

Press Ctrl+B, and then Q to make tmux briefly flash the number of each pane. These numbers are used in prompts and messages from tmux . Press Ctrl+B, and then X to close the current pane.


1 Answers

It seems xclip does not close STDOUT after it has read from tmux's buffer. As such, tmux doesn't know that the copy task has completed, and continues to /await xclip's termination, thereby rendering the window manager unresponsive.

source:https://wiki.archlinux.org/index.php/Tmux#X_clipboard_integration

Piping the output to /dev/null should fix it:

bind y run-shell "tmux show-buffer | xclip -sel clip -i > /dev/null"

See https://stackoverflow.com/a/21190234/109282 for more info.

like image 194
G Mawr Avatar answered Sep 20 '22 10:09

G Mawr