Hacker News new | past | comments | ask | show | jobs | submit login

You can achieve copy-pasting that isn't very different from a typical GUI without deviating too much from the defaults. If you use a sufficiently new version of tmux [1] and a terminal that supports it [2], you can just right click and drag your mouse to select and copy text into the clipboard. All you need to do is put the line 'set mouse on' in your configuration. If your terminal doesn't support this feature, you can do something like

    bind -Tcopy-mode-vi MouseDragEnd1Pane copy-pipe-and-cancel "if [ \"$(uname)\" = 'Darwin' ]; then pbcopy; else xclip; fi"
to achieve the same thing. It also looks like you can configure copy commands to pipe to a command of your choice with the upcoming version of tmux without having to override keybindings [3].

[1]: >= 2.4, maybe?

[2]: Any terminal that supports OSC52 (e.g, iTerm2)

[3]: https://github.com/tmux/tmux/commit/5aba26f2cb7aa9609a3c3d2b...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: