tmux-MacOSX-pasteboard
tmux-MacOSX-pasteboard copied to clipboard
Not needed for Tmux 2.6+
Since https://github.com/tmux/tmux/commit/78352fdd328b611d935ba051288191b33278cc4a and release 2.6 reattach-to-user-namespace
trick doesn't seem to be needed.
$ echo "test" | pbcopy
$ pbpaste
test
You're right. I removed all the relevant copy vi mode bindings and killed the tmux server (to remove config caching). I can achieve the same result by only supplying the following binding:
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
I'm on macOS 10.13 with tmux 2.6
Still needed for some cli tools, like trash
, or brew home xx
@lyuehh
I did install trash
from homebrew and executed
$ cd /tmp/
$ touch 123
$ trash 123
Afterwards, I verified that file "123" indeed was moved to macOS Trash.
Also, I tried brew home
with rust
and python
arguments. Both commands succeeded in opening respective homepages in default browser.
So, appears working for me 🤷♂️
@aleksandrs-ledovskis
On my computer , tmux was needed for trash
, I don't known why ...
Can we add to the README some text that says in what tmux/macOS version this is not needed? :)
I'm not entirely sure if this is even related, but if you're using a recent iTerm there is a option "Applications in terminal may access clipboard" in the Preferences. When it is selected Tmux copies directly to the macOS system clipboard when using copy mode without any configuration. This even works over SSH.
I can access pbcopy
et al. (also trash
) from within Tmux (version 2.7) on macOS 10.13.4.
@raejin are those even needed anymore?? I'm running tmux 2.7 and I can copy/paste to and from, no problem like any other app in mac (mojave)
@fdelacruz What method are you using? Aren't you mistaking text selection in terminal using mouse and pressing Cmd+C/Cmd+V vs. programmable copy & paste (as in pbcopy
/pbpaste
)
@aleksandrs-ledovskis Hi, well, I'm not using the mouse. I'm simply selecting the text in vim's visual mode, yanking and pasting outside of tmux. I can do the reverse from any app too. What gives??
I'm here wondering what am I doing wrong..
@fdelacruz Thing is, @raejin's comment/snippet refers to Tmux copy-mode
configuration & is not applicable/affecting applications launched within terminal multiplexer, such as Vim.
Regarding Vim and yank ending up in OS clipboard - could it be that you are yanking to plus/+
register (or have unnamedplus
in .vimrc
)?
@aleksandrs-ledovskis yes, I have mine configured as set clipboard=unnamed
.
Btw, i just copied from the top command in tmux into vim outside.
I'm on tmux 2.9a and I need reattach-to-user-namespace to prevent this issue: https://github.com/macvim-dev/macvim/issues/622