Monday 30 September 2019

vim - copy-paste not working in MacVim when launched in tmux


MacVim's copy-paste stops working when I launch it from a tmux terminal (on zsh). If I exit tmux and then launch MacVim copy-past works. Any idea how to fix this?



Answer



You might try the patch mentioned in a related thread (“OSX 10.6.5 , Terminal.app, iTerm.app pbpaste, pbcopy do not work under tmux”) from the tmux-users mailing list (actually hosted at sf.net, but I abhor their archive interface).


Note: the patch was, at one time, applied to the MacPorts port, but it was later reverted when it was suspected to be causing other errors. However, those errors might have actually been caused by liking against the wrong version of libevent (and it seems that recent versions of tmux will work with either version of libevent).




Since helgeg brought it up, I’ll mention my notes on my attempt to use the above referenced patch.


Summary: I found the patch unreliable. It allowed pasteboard access, but it triggered many warning messages from my installation of libevent version 2 (maybe version 1 is less affected). It also prevents the tmux server from doing its normal fork(2) (via daemon(3)), which is a significant change to how the server process was designed to work.


I ended up publishing a program that works around the problem without patching tmux. People that have had problems using the pasteboard under tmux (and those for which the above patch does not work satisfactorily) might want to give my workaround a try.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...