News for hackers. Stuff that matters.
Re:Tmux lets you select and copy text with your keyboard by ianthehenry on Thursday April 01, 2021 @11:06PM (#26668708)
I 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.

Re:Tmux lets you select and copy text with your keyboard by rekoros on Friday April 02, 2021 @08:05AM (#26670736)
I've used tmux for 10 years, and for 10 years I've struggled to copy text in tmux. To my defense, the documentation is impenetrable.

That said, so looking forward to copying text in tmux going forward. The instructions in the OP didn't work for me, but I found two other posts - one from 2013, one from 2016, the combination of which worked. Not only can I copy text to a tmux buffer now, but it automatically goes to the system clipboard. This feels like overcoming a major disability.

Re:Tmux lets you select and copy text with your keyboard by res0nat0r on Friday April 02, 2021 @11:02AM (#26671973)
I'm not sure why everyone goes so crazy over tmux, I've been using screen for 20 years now and it's generally installed everywhere by default, even on remote servers I don't have root on, so I don't have any real reason to switch. 99% of both of these things both do what I need daily, so I usually don't use tmux unless screen doesn't happen to be available for some reason and tmux does. But more power to the devs for wanting to rewrite screen to be more modern with some additional features.
Re:Tmux lets you select and copy text with your keyboard by irateswami on Friday April 02, 2021 @11:06AM (#26672002)
Screen is incredibly inefficient though.
Re:Tmux lets you select and copy text with your keyboard by res0nat0r on Friday April 02, 2021 @11:55AM (#26672539)
That's always been the argument, but it's always been perfectly fine for me. I'm using it to run long running background tasks, or just let me switch between multiple remote hosts patching / debugging them, not to render some kind of HD game.
Re:Tmux lets you select and copy text with your keyboard by fl0wenol on Friday April 02, 2021 @01:04PM (#26673350)
Genuinely curious: In what way?

Also: How is tmux about serial ports/USB->serial adapters?

Re:Tmux lets you select and copy text with your keyboard by mprovost on Friday April 02, 2021 @12:22PM (#26672853)
And yet... I've been using screen for 20 years and it never seemed inefficient, even when running on a 180MHz Pentium Pro. These days I have to believe whatever it's doing must be pretty minor compared to the overall system performance, but I'd be interested in hearing what it does so inefficiently.
Re:Tmux lets you select and copy text with your keyboard by guenthert on Friday April 02, 2021 @01:28PM (#26673628)
It worked fine in the early nineties on a '386. I can't tell how efficient it is, because I never had reason to worry about it.
Re:Tmux lets you select and copy text with your keyboard by gbraad on Friday April 02, 2021 @12:28PM (#26672922)
Still using screen to easily run a background which I can occasionally check up on. Never (perhaps once a year) seem to do this with tmux.
Re:Tmux lets you select and copy text with your keyboard by 0xEFF on Friday April 02, 2021 @10:08AM (#26671539)
You may already know, but in case not, you can also use this tmux feature from your editor. For example in vim

  :w !tmux load-buffer -
Writes whatever you have selected in vim into the tmux buffer through standard in.

Elsewhere you can paste like pbpaste.

  :r !tmux save-buffer -
The save-buffer command is’t the most intuitive name, but it’s saving to a file, stdout in this case.
Re:Tmux lets you select and copy text with your keyboard by russellendicott on Friday April 02, 2021 @10:55AM (#26671915)
I've been using tmux buffers for quite some time now but what always throws a wrench in my plans is when using tmux in SSH sessions there are always gotchas when getting access to my host's clipboard buffer depending on the platform (windows/mac/nix). The whole reason I dev remotely through SSH is so it doesn't matter what platform I'm coming from.

For example, from Windows these days I'm having to vim yank to file ~/clipboard and then I have a Windows keyboard shortcut to pscp that file locally && notepad file. Hacky, yes, but the muscle memory is there now so meh.

But that's just the flavor of the month this month...

Re:Tmux lets you select and copy text with your keyboard by AzzieElbab on Friday April 02, 2021 @06:59PM (#26676805)
I am by no means a tmux expert but I think I discovered copy paste-yank paste by accident because I use vi keys. Also, tmux on Mac feels weird compared to Linux terminal
Re:Tmux lets you select and copy text with your keyboard by simias on Friday April 02, 2021 @10:25AM (#26671668)
tmux's keyboard copy is rather intuitive... If you know emacs.
Re:Tmux lets you select and copy text with your keyboard by nobleach on Friday April 02, 2021 @12:46PM (#26673123)
The crazy thing there is that it uses Vim visual mode for selecting text `v` or `V`.
Re:Tmux lets you select and copy text with your keyboard by oblio on Friday April 02, 2021 @02:17AM (#26669376)
I've been using tmux for a while and I didn't know about this.

Just because an app has some features doesn't mean that everyone knows about them. In fact the opposite is true, most features are never discovered and even fewer are used, even "obvious" ones.

Re:Tmux lets you select and copy text with your keyboard by corndoge on Thursday April 01, 2021 @11:25PM (#26668774)
Been using tmux for many years and did not know it could copy text
Re:Tmux lets you select and copy text with your keyboard by ianthehenry on Thursday April 01, 2021 @11:31PM (#26668798)
Well, I stand corrected then. More discoverability would definitely make the world a better place. :)
Re:Tmux lets you select and copy text with your keyboard by minusf on Friday April 02, 2021 @06:16AM (#26670290)
it'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 :)

Re:Tmux lets you select and copy text with your keyboard by d33 on Friday April 02, 2021 @08:05AM (#26670737)
Docs aren't a replacement for a good UX.

Tmux comes from the times when this attitude was okay, but I feel that the standard now is raised and if the UI could give some feedback/help that doesn't require reading through all of the documentation, it's definitely something that should be prioritized.

Anti-example - help screens. Press ctr+b, then ?. Compare this to screen's ctrl+a, then ?. Both are quite terrible, but tmux definitely leaves users more disoriented while this isn't something that couldn't be avoided.

A simple message saying "you are in XYZ mode, type :help xyz-mode to get help" could go a long way. The RTFM philosophy combined with a wall of single-file manpage with no tutorial is something that I really wish died already.

Re:Tmux lets you select and copy text with your keyboard by soraminazuki on Friday April 02, 2021 @12:37PM (#26673027)
> Docs aren't a replacement for a good UX.

Tmux is a command line application, and the man page is a well understood convention for anyone operating on the command line. I don't think it's unfair to fault tmux for poor discoverability because its manual is informative, easy to read, and fits in a single man page. It's also unnecessary to "read through all of the documentation" before using tmux, spending 3 minutes to read the first two sections would suffice.

> Press ctr+b, then ?. Compare this to screen's ctrl+a, then ?. Both are quite terrible, but tmux definitely leaves users more disoriented.

There's no difference between the two. People who refuse to read the manual or any of the abundant online tutorials won't be able to deduce either.

> A simple message saying "you are in XYZ mode, type :help xyz-mode to get help" could go a long way.

I'd prefer applications like tmux not stand out more than necessary. Displaying that sort of message every time I press some key can get annoying pretty fast.

Re:Tmux lets you select and copy text with your keyboard by minusf on Friday April 02, 2021 @09:14PM (#26677584)
tmux has bad UX? ever used this unknown program called `git`?

ultimately a terminal multiplexer (and an editor) are complicated tools with steep learning curves, that's the price of the power that they enable. it's everybody's own choice how deep they want to get into it and how much time it saves for them.

do you have trouble finding tutorials for tmux? youtube is full of them. and there can be so many because the docs are excellent...

Re:Tmux lets you select and copy text with your keyboard by phone8675309 on Friday April 02, 2021 @10:20AM (#26671620)
> The RTFM philosophy combined with a wall of single-file manpage with no tutorial is something that I really wish died already.

With respect: what do you do for the tools you use to help this situation? The software is open source and accepts patches, and I'm sure they'd love to accept a patch that adds user-friendly documentation to the tool.

Re:Tmux lets you select and copy text with your keyboard by d33 on Friday April 02, 2021 @12:37PM (#26673021)
It sounds like a loaded question, but a perfectly valid one :) If you're asking whether I actually change the tools I complain about then the answer is "no".

The reason is that if you hate how, say, coreutils works and have a strong vision of how it should be restructured, it will boil down to being off-putting to the mainteiners at best and - at worst - becoming a rewrite anyway. This is why I see my role as more of a propagator of tools that want to dethrone the current defaults: I look out for new exciting projects that have wildly better ergonomics than what's most common and I recommend them to my friends. And given that I'm running a hackerspace in my city, I have a bit of a reach so I think that this strategy might be a net good. I also try to share knowledge on how to code and keep in touch with FLOSS communities, so while I might not be contributing code directly, I (hopefully) end up bringing contributors anyway.

And while we're talking about spreading the word when a project has good ergonomics, here are some examples I personally love:

1. "glances" - a tool that combines a couple of tools like top, iftop, iotop and various other monitoring programs into one CLI dashboard. It's a bit chunky, but its functionality justifies it. 2. "fd" (cargo install fd-find) - a simpler version of "find". instead of crazy "find -iname 'something" you can just do "fd something". It's also faster. 3. "ripgrep" - like fd, but for grep. Defaults to recursive grep and skips .gitignore, so you can just type "rg variableName" and see all occurrences of it within files in your directory tree.

But you're right, I love to complain and quite frankly, in many cases I'm disappointed by priorities some projects choose in terms of ergonomics. Disappointed up to the point that I gave up sending patches - or even filing issues (example: GitLab). Perhaps a solution to the problem would be to have something like a GitHub badge signalling "UX feedback is welcome" or "RTFM", depending on one's design philosophy? That would help developers reach their target audience, regardless of which side of the argument they prefer.

Re:Tmux lets you select and copy text with your keyboard by square_usual on Friday April 02, 2021 @01:00AM (#26669123)
Seconded. Used tmux for basic ops stuff for ~2 years, didn't know about copying.
Re:Tmux lets you select and copy text with your keyboard by chaps on Friday April 02, 2021 @01:28AM (#26669208)
Been using it for about five, and honestly I stopped using this in my workflows a long time ago. My workflow now is to ctrl-a+z to maximize the pane, highlight (with the mouse) and hit ctrl-insert to copy and ctrl-shift-insert to paste, then ctrl-a+z to restore the pane. It's still a bit of a pane, but it's deeply ingrained enough into my muscle memory that it's smooth.

But... sublime is my text editor for notes and SQL. Everything else text related is in a terminal with vim mode enabled universally. Not sure why SQL is so annoying with vim..

Re:Tmux lets you select and copy text with your keyboard by boogies on Friday April 02, 2021 @09:54AM (#26671418)
If you `set-option mouse on`, tmux will let you use copy-mode just by clicking and dragging (intelligently within panes, negating the need to resize-pane -Z). But TBH I often do almost the same thing (but Xorg does its part of the copy-pasta without forcing any Emacs-esque three-finger keyboard chording, thank goodness), selecting text is the only thing I ever use the mouse for in the terminal (except rare scrolling, especially overflowed weechat bars), so I keep tmux’s mouse support off.
Re:Tmux lets you select and copy text with your keyboard by chaps on Friday April 02, 2021 @05:39PM (#26676269)
Ah yeah, I use that configuration option (love it), but I think the issue is that highlighting text doesn't stay highlighted unless I hold shift -- which shifts the mouse functionality to the terminal emulator. Maybe there's a setting to get around that, but it hasn't been a big enough deal to really try and figure out.
Re:Tmux lets you select and copy text with your keyboard by disqard on Friday April 02, 2021 @02:32AM (#26669426)
> It's still a bit of a pane

I see what you did there :)

Re:Tmux lets you select and copy text with your keyboard by rgoulter on Friday April 02, 2021 @12:16AM (#26668978)
One feature to improve the discoverability of sequences of keypresses/chords is a which-key style UI. e.g. a panel will show the available set of next inputs which can be handled, and what their command is. https://github.com/justbur/emacs-which-key#more-examples
Re:Tmux lets you select and copy text with your keyboard by EamonnMR on Thursday April 01, 2021 @11:48PM (#26668865)
I used Tmux as my tiling window manager for a while and I didn't know this.
Re:Tmux lets you select and copy text with your keyboard by iopq on Friday April 02, 2021 @05:19AM (#26670079)
I've used it, but I use it like a retard so it's useful to me.
Re:Tmux lets you select and copy text with your keyboard by blueblob on Friday April 02, 2021 @12:01PM (#26672607)
I agree with the command discoverability. Not only does prefix+? show you the commands, it is also searchable, and if you use vi-mode, it uses the same search commands.
Re:Tmux lets you select and copy text with your keyboard by tomphoolery on Friday April 02, 2021 @10:21AM (#26671633)
fzf could in theory be used for this
Re:Tmux lets you select and copy text with your keyboard by lucideer on Friday April 02, 2021 @07:42AM (#26670617)
tmux user. This is news to me.