I am having a weird issue with MacVim running in a terminal and having clipboard access. At first, I could access the system clipboard using both the *
and +
registers fine. However, Vim by default doesn't handle mouse events, so I found the below combination of settings to make Vim handle them:
set term=xterm
set ttymouse=xterm2
set mouse=a
But as soon as I set term=xterm
, Vim stops accessing the system clipboard and I can't restore the default behavior by simply restoring the default term value (xterm-256color
). The only way to restore access to clipboard is by restarting Vim. I recompiled the latest MacVim from the git repo and still have this same issue.
If I don't set both term
and ttymouse
to the above values, mouse handling doesn't work right. E.g., if I leave the default term
value, then mouse clicks end up inserting escape sequences. I am looking for two possible solutions:
- A different term
value which for which both clipboard access and mouse work well
- Enable a flag and recompile MacVim
Does anyone know of a solution?
PS: I use iTerm2, but verified that the same issue occurs even on the default terminal.