14 ms·
Tmux lets you select and copy text with your keyboard
- mssundaram 6y agoAt my first SWE job I pair programmed every week with a greybeard who used vim and tmux (and didn't own a cellphone). I continue to be grateful for his mentorship
- jhvkjhk 6y agoI think the most intuitive way to select and copy is selecting with mouse and click the middle button to paste. Tmux don’t support this with `set -g mouse on`, but you can add this to your tmux.conf: ``` unbind-key MouseDown2Pane bind-key -n MouseDown2Pane run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" ``` However, this only works fine within tmux alone. When you select text in tmux, you can’t use middle button to paste them into other programs, the opposite is the same. I don’t know why.
- ianthehenry 6y agoIf you set up this binding: bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-no-clear 'xclip -i -selection primary' (or -T copy-mode, if you use emacs-flavored tmux) Then you can paste your tmux selections into other programs with middle-click -- I think by default tmux only uses the "clipboard" selection, but middle click pastes the "primary" selection.
- jhvkjhk 6y agoWow thank you, this binding works very well! It used to be very annoying to copy-paste between tmux and other softwares, but there won’t be any problems in the future!
- yomly 6y agoPresumably you need some callback attached to tmux set-buffer to make an xclip -i call But my tmux-fu isn't really up to scratch on how you do that...
- jhvkjhk 6y agoThank you, the author gives a working binding in another reply(https://news.ycombinator.com/item?id=26669079 https://news.ycombinator.com/item?id=26669079), and the binding uses xclip -i like you said.
- ibraheemdev 6y agoAlacritty has this feature too (and much more) with vi mode [0]. 0: https://github.com/alacritty/alacritty/blob/master/docs/features.md#vi-mode https://github.com/alacritty/alacritty/blob/master/docs/feat...
- colordrops 6y agoAlacritty is a different thing from tmux. Alacritty is a terminal, tmux runs in a terminal. They go well together.
- ibraheemdev 6y agoI understand that. My point is, if you use tmux only to copy paste text, know that terminal emulators can do that too :)
- ianthehenry 6y agoOh, cool! I've never heard of alacritty. I tried playing with it but it doesn't seem to recognize my control key (???) which makes a lot of things... hard. A quick google and glance through the settings didn't reveal any likely culprits, but I expect it's some macOS thing. Anyone know what's up with that?
- vulcan01 6y agoMost (all?) Alacritty commands use the command key on Mac: command+c to copy, etc. Or maybe it's something with .alacritty.yml or keybinding?
- ianthehenry 6y agoYeah, I couldn't figure it out looking through the default alacritty.yml. I'm not trying to use the normal system shortuts, but like, ctrl-d to EOF and ctrl-c to SIGINT and that sort of thing.
- petepete 6y agoNot really answering your question but you might have more luck with Kitty. Like Alacrity it's very fast but Kitty has a more features. https://sw.kovidgoyal.net/kitty/ https://sw.kovidgoyal.net/kitty/
- enthdegree 6y agocritical point >tmux’s copy commands [may not] integrate with the system clipboard [by default on all terminal emulators]
- tjoff 6y agoBut you can configure it. And it is quite usable even without it. The copy-buffer exist for all tmux session on the same system (tmux-server) so you can share between different panes/windows in current session as well as other sessions.
- mkhnews 6y agoExactly. Granted, I've spent some time on my tmux config, but it is just how I want it, and it's incredibly productive. I can copy to/from the clipboard/selection just fine, between windows and vim and firefox, etc. using the keyboard or mouse. I can go into copy-mode-vi (scrollback buffer) with the PageUp key or mouse wheel from the shell (not from within apps). And the added bonuses of, for example, popping a tmux window of fzf git branch output to choose from for a checkout is nice.
- spicybright 6y agoThe fact an article like this exists speaks to how bad the keyboard shortcuts for tools like tmux are. It shouldn't be revolutionary to use basic features of a program. I'm a huge fan of a command window, where you type words to do a fuzzy search of all the commands in a program. Sublime text and jetbrains products have it down so well to the point of me not needing to memorize key shortcuts. I just have to remember the first few letters and I'm good to go.
- ianthehenry 6y agoI don't think that's fair: this is not news to anyone who has ever used tmux. This post was written for people who have never tried tmux, but who might want to if they knew about this feature. I think tmux actually has good command discoverability (once you install it) -- prefix + question mark lists all the keybindings, with user-friendly descriptions of what they do. That said, I agree with your larger point completely -- I love Sublime's command palette, and I love using ivy/counsel for M-x in emacs. It would be even better if tmux had something like that.
- corndoge 6y agoBeen using tmux for many years and did not know it could copy text
- ianthehenry 6y agoWell, I stand corrected then. More discoverability would definitely make the world a better place. :)
- minusf 6y agoit's called reading the docs... some tools are so feature packed there's no way to discover/know everything and that's fine. i didn't discover tmux could copy text until i got really annoyed by selecting with the mouse... not annoyed = not discovered :)
- edoceo 6y agoSee also https://tmuxcheatsheet.com/ https://tmuxcheatsheet.com/
- X6S1x6Okd1st 6y agoI've been using neovim as my terminal multiplexer for a couple years now. I can use all the same key commands for yanking and pasting buffers from a file buffer to a terminal buffer.
- phasnox 6y agoI tried this once, but I can't recall why I stopped. Do you have any particular issue? Does it give you a real tty?
- gkop 6y agoFor me, when I went and tried a vim terminal buffer a few years back, I learned that my habituation to the emacs-style shell shortcuts (ctrl-a, ctrl-e, etc) was a significant (and dumb) barrier, that I didn't care to overcome.
- X6S1x6Okd1st 6y agoI will say that at default it's kind of a pain switching between terminal buffers and normal buffers. <C-\><C-n><C-w>l is just too much to type over and over. I do <Leader>l as the way of escaping any buffer I am and and moving the buffer to the right
- ma2rten 6y agoIs that very different from the Terminal in Vim 8.1+?
- X6S1x6Okd1st 6y agoI started using it before that was introduced. I haven't tried going back.
- u801e 6y agoI haven't used neovim, but it certainly is possible to use vim with its terminal feature as a terminal multiplexer. The way I do it is to use a single instance of vim to handle the multiplexing and just run whatever I need in different split windows or tabs. If I need to copy, I'll use the terminal normal mode (ctrl-w N) and visually highlight text and copy it to the + register. Then I can paste the contents in another application. The only issue I've encountered is that some text that's not supposed to be wrapped has line breaks added at the screen width. In that case, I'll paste the text into another vim buffer first and remove the line breaks using gJ. then copy and paste it into another application. For copying text from another application back into vim, I'll just highlight it with the mouse and paste it into vim using ctrl-w "*
- sigjuice 6y agoFor me, the killer feature of tmux is actually the mouse support (e.g. clickable window names, pane selection, scrolling, copy/paste), which works even over ssh.
- enriquto 6y agoYes, but it's a shame that tmux is not a good "x11 citizen". If you select some text inside tmux, you cannot middle-click on another window to copy it. Likewise, if you select some text on a non-tmux window, you can copy it everywhere, except on your tmux session. For me this means that the mouse support is severely broken, and I actually prefer to use "tmux set mouse off", by which all goodies are lost, but at least I can copy-paste like a human being.
- ianthehenry 6y agoYeah. It's not completely tmux's fault -- it's doing what it can, in a terminal emulator -- but it could be smarter. You can make it behave the way it should with a couple lines in ~/.tmux.conf: # copy on select bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-no-clear 'xclip -i -selection primary' # paste on middle click bind-key -n MouseDown2Pane { select-pane -t=; run 'tmux set-buffer "$(xclip -o -selection primary)"'; paste-buffer } (s/xclip/xsel, depending on your system.)
- enriquto 6y agowow, many thanks! This is a neat hack. I wonder why this very natural behaviour is not the default. Your solution is almost perfect. The "paste" code works as expected. But the "copy" code, apart from copying the selection into the clipboard, leaves the tmux pane in an odd state (copy mode) from which you have to exit manually. Would it be possible to bind the command to something that quits copy mode afterwards?
- ianthehenry 6y agoYep! Use copy-pipe-and-cancel instead of copy-pipe-no-clear. I don't think tmux has any, like, OS-aware anything. It can copy to the system clipboard, but only by asking your terminal emulator to copy. To work the way you expect, tmux would need to know to use xclip on Linux and pbcopy/pbpaste on macOS or whatever. Which would be pretty nice! That would be a great, easy feature that would cover ~99% of users. But it seems like it deliberately doesn't want to (?). I'm speculating there.
- rrradical 6y agoI wish tmux had the ability to pipe the buffer to some external program, e.g. vim. Their vi-mode is okay, but it's never going to be the same as native vim with my configs, plugins, etc. That aside, I do really enjoy tmux and appreciate the hard work of the devs!
- ianthehenry 6y agoYou can do that! tmux capture-pane -p -S - | vim - Or bind that to a key. -p is "print to stdout", -S specifies where to start and - means "the beginning of history" (by default capture-pane just gives you the visible contents). I'm not sure how to do the same thing with the current selection -- copy-pipe doesn't seem to work with vim, for some reason.
- vbsteven 6y agoIn the same vein, I use this in my .tmux.conf: bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"' And with that I can just hit `<prefix> u` to pipe the current pane into urlview. Typical use is for example when pushing to a branch and bitbucket prints the URL to create a PR to stdout. I hit `<prefix> u`, `<enter>` and the link is open in Firefox.
- rrradical 6y agoThanks, that seems close to what I'm looking for, but I'm not sure how to get a keybind that has behavior similar to scrollback mode. I think tmux is missing the ability to give control over to an arbitrary shell command. For example, if I bind that to a key, I can only run it in the background right?
- seqizz 6y agoI'm using extrakto[0] for it, so far it works nice. [0]: https://github.com/laktak/extrakto https://github.com/laktak/extrakto
- ianthehenry 6y agoThat looks great! Someone also pointed me at tmux thumbs, which takes a more vimium approach to this. I've got to try both of these. https://github.com/fcsonline/tmux-thumbs https://github.com/fcsonline/tmux-thumbs asciinema demo here: https://asciinema.org/a/232775?autoplay=1 https://asciinema.org/a/232775?autoplay=1
- betoharres 6y agoi use this plugin everyday for my workflow; it's amazing how fast I became to copy/paste things from terminal. Sometimes I don't even see what's being shown, I just type and hit enter and I know that text is copied.
- nandkeypull 6y agoextrakto is really a "killer" plugin. I'm starting to wish for an emacs plugin with similar functionality.
- jcard 6y agoUsing the tmux vi keybindings to copy and paste between panes is great if you haven't tried it. This copy/paste workflow is really nice for working with kubernetes on the command line. E.g., imagine that you need to delete a kubernetes pod. You'd run a few commands like this: 1. `kubectl get pods` 2. Find the pod id, and copy it using mouse & some shortcut 3. `kubectl delete pod <pasted-pod-id>` Instead of this mouse workflow, you could do something like this in tmux: 1. `kubectl get pods` 2. Find pod id, `Ctrl+b [` to enter tmux's vi selection mode 3. Navigate to the section you'd like to copy; e.g. `k6ww` (up six lines and over two words, for example) 4. Press space bar to start selection, and use common vim movements to highlight what you'd like to copy (e.g. w or $) 5. Press return/enter to copy the selection 6. This text can be pasted with either Cmd/Ctrl+v (it gets copied to the system clipboard for me on macOS 11.2.1 with tmux 3.1c_1 from brew), or using the default tmux shortcut `Ctrl+b ]`. So that would allow you to type `kubectl delete pod Ctrl+b ]`. So yeah, it's a few more steps, but it's a lot faster for me. These are the relevant sections of my ~/.tmux.conf file: # Use vim keybindings in copy mode setw -g mode-keys vi # Use emacs keybindings in the status bar set -g status-keys emacs (I mention the `set -g status-keys emacs` config line just as an FYI since it's been really helpful for me with tmux. I've never liked using readline-type inputs with vi-mode.)
- Leo_Verto 6y agoHave you tried k9s [1]? Just being able to run common operations directly on k8s entities is so much better than having to run a separate command. It also uses vi-style hotkeys. [1]: https://k9scli.io/ https://k9scli.io/
- jcard 6y agoI haven't tried it, but that looks pretty great! Kind of like a TUI version of something like Lens.
- oftenwrong 6y agoThat's all fine, but why not use kubectl's excellent tab completion? kubectl delete pod <tab> and it lists the pods. For bash or zsh: source <(kubectl completion $(basename $SHELL))
- deleted 6y ago[deleted]
- cauthon 6y agoDoes this work for a tmux session on a remote host? Seems like it would only work with access to the local system clipboard
- jcard 6y agoThis should work the same locally & on remote hosts. Tmux doesn't care that you're ssh'd into some host. As long as your system & version of tmux supports copying to the local clipboard, you should have no problems pasting with either Ctrl/Cmd+v or `Ctrl+b ]`. Otherwise, if the clipboard is broken for some reason, you can stick to using `Ctrl+b ]` to paste.
- ianthehenry 6y agoIt... depends. If your terminal emulator supports the clipboard escape codes, then yes -- it just works, and there's nothing for you to do to set it up. This is because when you hit "copy" tmux just prints a bunch of escape codes, and ssh will re-print the escape codes locally, and your terminal emulator will see them, and know to set the contents of the system clipboard. If your terminal emulator doesn't support the clipboard escape codes, then you have to configure an explicit copy-pipe command, like this: bind -T copy-mode-vi y send -X copy-pipe 'xclip -i -selection clipboard' And that will work on a remote tmux, as long as you ssh to the remote server with X forwarding (ssh -X or -Y). If you're not using X and your terminal emulator doesn't support the escape codes, then I think the answer is no. Like if you're using a Mac and using Terminal.app instead of iTerm, I'm not sure how you would make this work.
- bryogenic 6y agoI took this tmux config line to the next level because: - I want it yanked into both the selection AND the default clipboard - I want tmux to exit copy mode after yanking bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection default; xclip -o | xclip -in -selection clipboard'
- TBurette 6y agoTo me, copy/paste is a weakness of a workflow using tmux. With tmux you end up with four distinct copy/paste buffers: the OS, tmux, the shell, vi/emacs. You do get used to the mental gymnastic of juggling all those but it's not ideal. Same goes with managing the windows of the OS, tmux and vi/emacs.
- vulcan01 6y agoFYI, you can use vim's clipboard register * on linux/Mac (might be + on Windows?) to make it use the system clipboard. (Or `:set clipboard=unnamed`)
- ianthehenry 6y agoOh, yeah. I can't keep multiple clipboards straight. I configure everything to share the OS clipboard (except my shell... but I don't really use my shell's copy buffer since I got in the habit of using ctrl-q). tmux will copy to your system clipboard by default if your terminal emulator supports the right escape sequences. If it doesn't, then you do need to configure it to shell out to xclip or pbcopy or whatever. It's annoying, but I find it less annoying to configure it than to try to keep multiple copy buffers straight.
- revscat 6y agoEchoing others: I have the tmux copy/paste mapped to my system pasteboard. Ditto nvim. I do not use the shell buffers. The cognitive load you are concerned about can be configured away, and for me is a solved problem.
- nikisweeting 6y agoSame on macOS with iTerm's Tmux integration, everything just uses the system clipboard buffer seamlessly, even when copying inside tmux on a remote ssh connection.
- adverbly 6y agoWorks great till you want to copy a ton of text. I frequently need to look up some command to dump the tmux scrollback to a local file because I could only get a couple thousand lines from the buffer. It's the best option I've found, but it's not all smooth sailing for me at least.
- donio 6y agoI use this snippet in my .zshrc to make M-v enter copy mode and start scrolling up like it does in Emacs: tmuxup(){tmux copy-mode -u} zle -N tmuxup bindkey '^[v' tmuxup The advantage of this is that you don't hijack M-v from a real emacs running in tmux. It's only active when I need it to: while sitting at the shell prompt. I guess you could also bind it to PgUp or C-u if you are using the wrong editor.
- Parae 6y agoIt makes me think of insert mode and selection mode of Termite. It uses many command from Vim, it's useful and well done !
- SomaticPirate 6y agoiTerm2 has copy-mode with Vi keybindings by default with Cmd + Shift + C. Feels like a natural extension of Cmd + C. It also plays wonderfully nice with tmux
- josteink 6y agoSo does GNU screen?
- totetsu 6y agoCtrl+a ESC arrows to start Enter arrows to end Enter. Ctrl+a ; to paste? .. of the top of my head
- tarkin2 6y agoCame to say that - ctrl-a [ - move to the text you want - press space to start selection - press space to end selection - go to another screen, ctrl-a ] to paste copy mode and scrollback in gnu screen is great to quickly scan tail -f commands.
- avinassh 6y agoI use iTerm 2, I like its copy mode[0]. Feels quite natural with mac's keys. Check these simple instructions [1] 1. Enter copy mode with cmd+shift+c. 2. Basic Vim keybinding, many keystrokes can active different actions. - v to select by character. - shift+v to select by line. - ctrl+v for rectangular selection. - ctrl+space to stop selecting. - y to yank/copy the selection (also exits copy mode). - q to exit copy mode. [0] - https://iterm2.com/documentation-copymode.html https://iterm2.com/documentation-copymode.html [1] - https://kevinjalbert.com/iterm2-mouseless-copy/ https://kevinjalbert.com/iterm2-mouseless-copy/
- yoz-y 6y agoIs this different from the ctrl+[ ctrl+space ctrl+b ] workflow? as those are not mentioned.
- CodeGlitch 6y agoOne thing I've tried recently is running the terminal command inside vim. You have vims features of tabs and windows, plus being able to copy and paste between the terminal and editors all within vim. I'm still undecided if this is a good workflow or not.
- bassdropvroom 6y agoTwo things I've struggled to get working on my tmux is with mouse selection. While I use the keyboard way more, sometimes a mouse is easier. Anyway, when I select something with a mouse, it is not possible (or at least I've not found a solution) to let go of the MB1, and that automatically quits visual mode. And the other thing is when you scroll down to the bottom, it automatically quits visual mode.
- ianthehenry 6y agoYou can have your mouse copy and get you out of copy mode like this: # native mode, if your terminal supports it bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel # or if you're using X, and want it to work like any other program bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'xclip -i -selection primary' The scroll thing is a little hairier looking: bind -n WheelUpPane if -Ft= "#{mouse_any_flag}" { send -M } { if -Ft= "#{pane_in_mode}" { send -M } { copy-mode -t= } That's just the default binding for WheelUpPane, except using bare copy-mode instead of copy-mode -e (-e is auto-exit when you scroll to the bottom).
- fphilipe 6y agoI can highly recommend these tmux plugins that enhance the selection experience: - https://github.com/tmux-plugins/tmux-yank https://github.com/tmux-plugins/tmux-yank - https://github.com/tmux-plugins/tmux-open https://github.com/tmux-plugins/tmux-open - https://github.com/tmux-plugins/tmux-copycat https://github.com/tmux-plugins/tmux-copycat
- tjoff 6y agoOnly glanced at it but didn't see it mention 'V' which selects rows rather than characters. Which can be quite useful. There are also tmux plugins to make some operations smoother. https://github.com/fcsonline/tmux-thumbs https://github.com/fcsonline/tmux-thumbs Like keyboard driven browsers uses hints, so file paths, git SHAs etc. are highlighted using a small hint and if you press it it is copied. https://github.com/laktak/extrakto https://github.com/laktak/extrakto Fuzzy search in current pane to insert/copy things of interest.
- a-dub 6y agofor next level ninja copy paste, use vim-slime to send regions of text from vim into a repl running in a tmux window using bracketed paste mode.
- 1vuio0pswjnm7 6y agoI prefer to copy text from outside tmux using capture-pane and load-buffer. Outside tmux, to send buffers to stdout, I use save-buffer. I usually paste inside tmux. I re-attach then paste with the keyboard sortcut "Ctrl-B ]" I put tmux commands like capture, load-buffer, save-buffer and list-buffers in one line shell scripts with short names for use outside tmux. Otherwise typing the commands is too verbose, e.g., tmux capture -t0 -p|grep -o PATTERN|tmux loadb -;tmux lsb
- jftuga 6y agoThis is my .tmux.conf along with a brief tutorial. It uses the "screen" prefix of Ctrl-A (instead of the default, Ctrl-B). https://github.com/jftuga/universe/blob/master/tmux.conf https://github.com/jftuga/universe/blob/master/tmux.conf
- alexsuslin 6y agoIs there any decent tmux tutorial (more structured than official documentation in case of learning), preferable videos with some exercises?
- deleted 6y ago[deleted]
- lou1306 6y agoI'm probably an outsider here, but as an iTerm user my usual way to copy short pieces of text from tmux is to just disable mouse reporting, select the text with my mouse, and do the good old cmd-c. Not really a sophisticated approach but it gets the work done, and works just as fine on remote tmux sessions.
- mdaniel 6y agoIf you weren't already aware, you can just drag the selected text slightly and it will retype it at the current prompt position, without dirtying your clipboard. QTerminal does the same on Linux, and likely other terminal emulators, too Or if you are copying it out of iTerm, replace "slightly" with "to the other terminal" :-)
- phil294 6y ago...or press middle mouse button (iirc)
- vptr 6y agoI think a more killer feature of tmux is that you can send keystrokes to apps running inside tmux (with send-keys). It just opens a door for scripting CLI apps that otherwise would not be scriptable. e.g. irc clients and similar full screen apps.
- 2OEH8eoCRo0 6y agoThat's sick and good to know. I can use that on my current project.
- ianthehenry 6y agoTo add to this, I have used tmux for automated testing of full-screen interactive command-line apps. It comes out like PhantomJS: send-keys + capture-pane is pretty awesome (once you overcome dumb timing stuff).
- cryptonector 6y agoYou might want to look into expect(1).
- adverbly 6y agoYep. This is a killer feature for me. I have a ton of scripts that open new split screens and ssh into things to tail logs or others that ssh, change users, start some other console/repl/shell, then run a few commands in that. I'm sure there's better ways to do it but it's been enough to speed up a lot of the simple repetitive things for me.
- forgotpwd16 6y agoUrxvt users can use the keyboard-select Perl extension instead.
- jolmg 6y agoBiggest reason why I stick to urxvt.
- forgotpwd16 6y agoThe Perl extensibility or that specific extension?
- jolmg 6y agoThe specific extension, though the Perl extensibility is also a reason.
- patricius 6y agoVim's :term command has become my go-to way to open up a terminal nowadays. It gives you nice terminal emulation, but also lets you stay in Vim and use all the Vim keyboard mappings. When a terminal window has focus, you can go into Normal mode with `Ctrl+W N`, which will let you search and yank stuff like you're used to.
- clipradiowallet 6y agoTIL `:term`. I've been using vim/tmux (and before that, vim/screen) for nearly 30 years. I never knew about `:term` before that, thanks for posting. PS: And when the terminal session exits, the history is still a vim buffer - that's awesome!
- graywh 6y agoit hasn't been in Vim very long, added in 8.1 ~3 years https://www.vim.org/vim-8.1-released.php https://www.vim.org/vim-8.1-released.php
- leephillips 6y agoEven more awesome: vim-repl (https://github.com/sillybun/vim-repl https://github.com/sillybun/vim-repl) uses the :term feature to provide convenient communication with any REPL, with extra support for some languages such as Python. (In fact there are a host of these; for example, vim-slime now can communicate with Vim’s built-in terminal.)
- tomphoolery 6y ago...so does zsh with vim mode turned on :P
- krisgenre 6y agoBeen using Tmux for around 6 months. I frequently use prefix + [ shortcut but always thought of it as "Scroll mode", never realized that its called "Copy mode" nor that one could copy text using keyboard.
- nobleach 6y agoI've used Tmux for around 8 years, and I've never had a pleasant copy/paste experience. This is not for lack of reading plenty of Google search results, installing different plugins, aliasing long command strings, to keyboard shortcuts. In the end, I'm still back where I started. I grab my mouse, highlight the text and pray that it's not longer than what fits on the page. I then hit Control+Shift+c, and I have the text on my clipboard. I've heard that there is a way to do this in a more vim-like fashion, but I've never actually gotten it to work. I used "Copy mode" every single day to be able to read what's in my scrollback buffer (test results, error output, etc) but using a key to start highlighting and copying contents to my clipboard? Man, that'd be awesome.
- ianthehenry 6y agoI am curious to hear about your experience. What OS and terminal emulator do you use? Do you run tmux on a remote host that you SSH into? If your terminal emulator doesn't support copy escape codes, and you're running it on a remote server, you need to ssh with X forwarding in order to share your system clipboard. I realized over the course of this thread that I know a weird amount about configuring tmux. I rely on this feature pretty heavily, so I've had to set up system clipboard integration on Mac and Linux across on multiple different terminal emulators. I'd be happy to help you get a config that works on your system, if you want.
- nobleach 6y agoI've used quite a few combinations over the last few years. These days I'm using Termite locally on Linux. In the past I've used iTerm on macOS/OSX. To be very clear here, I can copy text from pane to pane. (using control+] to paste) Judging by some recently commented lines in my tmux.conf. I've tried: # bind C-y run "tmux save-buffer - | xclip -selection c"\; display-message "Buffer copied to clipboard" # bind y "xsel -i --clipboard" # bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip"
- groundCode 6y agoNot Tmux, but one of my favourite things about iTerm2 is the search/copy functionality from the keyboard. I often find myself reaching for it, for example git log - see a commitish I want to fixup cmd-f type first few letters hit tab to get to the end of the commitish cmd-c esc cmd-v to paste it The other great thing is when you have cmd-f going and there are multiple hits in your terminal, hitting enter cycles you through them backwards.
- charsi 6y agoI use tmux (inside mintty) on my windows work laptop to pretend I am on Linux. Have been using this copy paste feature regularly too. Didn't realize it was so niche. Tmux is easily the most indispensable piece of software for my workflow. How else would I jump across different work spaces at lightning speed? For people unfamiliar with tmux these are some other features I use - C+a . space -> switches layout from vertical to horizontal and back C+a . , -> lets me rename the window so I know what I have open there C+a . [ . C+s -> search in previous output. n lets me me then jump to next occurrence of what I am searching.
- juloo 6y agoI switched from using tmux to using only Vim a year ago and I'm not looking back. I'm opening an instance of Vim per projet and that's it. I use the :term command for running any CLI tools that I haven't integrated to Vim yet and I can use normal and visual modes on their output. I'd recommand using tmux over your terminal's splits/tabs but I'd definitely recommand dropping tmux if you are nesting something smarter in it (emacs, vim).