Live data from Hacker News

Tmux for Mere Mortals

zserge.com

31–40 of 171 posts

Re: Tmux for Mere Mortals

#31
post #20

Earlier quoted context omitted.

The top reason I did start using tmux was because of how you can select text with the keyboard in copy mode (like visual in vim mode). Then I got the plugin tmux-plugins/tmux-yank which adds "y" command to copy the text. Also works with selection by mouse. I've run this setup now for something like 5 years across multiple tmux versions and OSes (Ubuntu and Arch) without any hiccups. But then I think tmux is a tool ge…

> The top reason I did start using tmux was because of how you can select text with the keyboard in copy mode (like visual in vim mode). Then I got the plugin tmux-plugins/tmux-yank which adds "y" command to copy the text. Also works with selection by mouse. Sure, but this is the internal "copy mode" of tmux, and is not useful to copy text in and out of your terminal.

You can configure tmux to synchronize with the X clipboard, although it is somewhat fiddly because of how terminal emulators work. See this page: https://github.com/tmux/tmux/wiki/Clipboard

In most terminal emulators you can also use Shift (or sometimes a different modifier) to bypass application mouse mode and have the terminal emulator handle the mouse event. Of course you can't copy out of the history with this, but that is another limitation of terminal emulators.

Re: Tmux for Mere Mortals

#33

Tmux is amazing, my only request is there be an option to name panes (with the names showing perpetually on top or bottom of the pane). Every time I ssh into an ec2 instance I can't remember what logs are showing in each pane!

You can do this. Turn on pane status lines (set `pane-border-status` option to `top` or `bottom`). You can then change `pane-border-format` to contain the text you want. It can show the application-set pane title (`#{pane_title}`, also settable with `selectp -T`) or anything else really.

There are no builtin pane names but if you are running tmux 3.0a or later you can just set a pane user option like `set -p @myname name1` then use it in `pane-border-format` with `#{@myname}`.

Re: Tmux for Mere Mortals

#34
So I predominantly use Macs. The one and only reason why I personally use tmux is because of tmux -CC. I never bothered with screen/tmux simply because I didn't want to learn another whole new set of keybinds (let alone reconfigure them). tmux -CC largely behaves as a native app. Want a new tab? CMD+T. New window? CMD+N. Scrollback with the trackpad. That sort of thing.

The complete system is iterm2 + tmux -CC + et (EternalTerminal) for persistent ssh connections.

Re: Tmux for Mere Mortals

#35

Earlier quoted context omitted.

> The top reason I did start using tmux was because of how you can select text with the keyboard in copy mode (like visual in vim mode). Then I got the plugin tmux-plugins/tmux-yank which adds "y" command to copy the text. Also works with selection by mouse. Sure, but this is the internal "copy mode" of tmux, and is not useful to copy text in and out of your terminal.

You can configure tmux to synchronize with the X clipboard, although it is somewhat fiddly because of how terminal emulators work. See this page: https://github.com/tmux/tmux/wiki/Clipboard In most terminal emulators you can also use Shift (or sometimes a different modifier) to bypass application mouse mode and have the terminal emulator handle the mouse event. Of course you can't copy out of the history with this, b…

> that is another limitation of terminal emulators.

This seems more an excuse than a cause. When the "mouse mode" of tmux is off, the copy-paste mechanism works perfectly. There is no reason why this couldn't still be the case when the mouse mode is on. For example, tmux could enable the mouse only for scrolling and resizing the panes, while keeping the correct copy paste behavior intact. But it chooses not to.

Re: Tmux for Mere Mortals

#36
post #26

After a few years in tmux, I actually moved back to just iterm2 (I'm always on osx). There are many new Iterm2 features over the last few years that make tmux unecessary IMO. - Iterm2 can now restore sessions, even partially after a reboot (attempts to recreate workspaces). This was the main benefit of tmux for me. - Iterm2 can also have a visual mode to browse your scrollback buffer, and there are some shortcuts sim…

These others are fair points but:

> Text, colors, etc... appear sharper without tmux.

The renderer is the same, iTerm2 just gets its data stream from tmux rather that from the program running in tmux. There is no difference in the display.

Re: Tmux for Mere Mortals

#37
post #18
post #10

Spent too much time wonking a tmux config only realizing it was never going to work how I liked. You can't have it all with the mouse no matter your settings, there will always be a compromise. It also doesn't help that no one cites the version of tmux they wrote their configs for, nor that the configs are not backwards compatible with all versions of tmux for all settings. It's really clunky, but I went from tmux to…

> realizing it was never going to work how I liked. > You can't have it all with the mouse no matter your settings > so I went back to just using the cursor to move things around. These tools (vim, tmux, etc.) work great for mouseless setups. If you can get comfortable with a 100% keyboard control paradigm, it might work for you. I realize this might not be what you want, but if the statement "spend less time moving…

My biggest problem with "mouseless tmux" was copy-paste. How do you deal with that?

Re: Tmux for Mere Mortals

#38
post #37
post #18

Earlier quoted context omitted.

> realizing it was never going to work how I liked. > You can't have it all with the mouse no matter your settings > so I went back to just using the cursor to move things around. These tools (vim, tmux, etc.) work great for mouseless setups. If you can get comfortable with a 100% keyboard control paradigm, it might work for you. I realize this might not be what you want, but if the statement "spend less time moving…

My biggest problem with "mouseless tmux" was copy-paste. How do you deal with that?

I use tmux copycat paired with yank, which makes reverse searching and copy paste much easier.

https://github.com/tmux-plugins/tmux-copycat

The other change is to use vi keys for highlight mode:

    # set highlight mode keys
    setw -g mode-keys vi
    bind Escape copy-mode

Re: Tmux for Mere Mortals

#39
post #37
post #18

Earlier quoted context omitted.

> realizing it was never going to work how I liked. > You can't have it all with the mouse no matter your settings > so I went back to just using the cursor to move things around. These tools (vim, tmux, etc.) work great for mouseless setups. If you can get comfortable with a 100% keyboard control paradigm, it might work for you. I realize this might not be what you want, but if the statement "spend less time moving…

My biggest problem with "mouseless tmux" was copy-paste. How do you deal with that?

C-b [ goes into copy mode,then you can traverse the screen with arrows.

C-Space marks a region, move arrows to select text, and M-w to copy to clipboard.

q to escape copy mode

Re: Tmux for Mere Mortals

#40
post #9
post #5

> Now tmux feels like a regular desktop app and truly boosts the productivity in the terminal. What do you think? I think it's really nice. Well done! > Mod+V: split vertically > Mod+B: split horizontally (“bisect”) That's smart . I love it! % and " tend to feel... just weird. I can see the visual cue, but it's always been weird to me nonetheless.

I’ve always done: > Mod+| for vertical split > Mod+- for horizontal split I’ve been using it like that for years, but haven’t seen it in too many places like that. It just feels super logical since the symbols look like the split!

Could not agree more. I throw in underscore and backslash for good measure too:

  bind-key | split-window -h
  bind-key \ split-window -h
  bind-key - split-window -v
  bind-key _ split-window -v
Post reply on HN