Hi,
I'd like to send the tmux 'save-buffer' to the X clipboard.
This command is working fine if executed from a shell:
tmux save-buffer - | xclip -i -selection clipboard
I can then correctly paste the 'save-buffer' to Chromium, LibreOffice, etc
but
if the same command is executed from tmux with a custom key binding, it also
pastes to the X clipboard but tmux seems to be "partially" hung: I can still
work in the current window but I can't create a new one with prefix-c nor
enter
the tmux command prompt with prefix-:
The funny thing is that if I run 'tmux next-window' from the shell inside
Tmux, it's working.
It seems that Tmux is stuck in the copy-mode or something but nothing
specific appears on the screen.
If I kill xclip, then prefix-c and everything are working again as expected
and Tmux seems to process the backlog of keystrokes.
Xclip runs in background, here is how it works as described in the manual
page,
I guess this is probably what makes tmux unhappy:
xclip was designed to allow tighter integration of X applications
and
command line programs. The default action is to silently wait in
the
background for X selection requests (pastes) until another X
applica-
tion places data in the clipboard, at which point xclip exits
silently.
You can use the -verbose option to see if and when xclip
actually
receives selection requests from other X applications
I'm using tmux 1.8-3 under latest Debian/sid and Awesome 3.4.6-1.
Here is the configuration I use to reproduce the issue:
unbind [
bind [ run /home/cyb/bin/cyb-tmux-copy-mode
And the shell script:
set -e -u
previous_buffer=$(tmux save-buffer - | md5sum)
tmux copy-mode
# loop until 'save-buffer' has been changed
while [ "$(timeout 1 tmux save-buffer - | md5sum)" = "$previous_buffer" ]
do
sleep .1
done
# xclip hangs tmux
tmux save-buffer - | xclip -i -selection clipboard
Is there another way to send the 'save-buffer' to X clipboard?
Do you know why tmux seems to hang when xclip runs?
Is there a way to work-around this?
Regards,
--
Cyril Bouthors
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users