Live data from Hacker News

Getting Started with Tmux

ittavern.com

71–80 of 160 posts

Re: Getting Started with Tmux

#71
If you're used to Vim key binding, you should feel at home with tmux after setting up Vim-like keybindings to move around (select panes/windows and resize):

  bind h select-pane -L
  bind l select-pane -R
  bind k select-pane -U
  bind j select-pane -D

  bind -r C-h select-window -t :-
  bind -r C-l select-window -t :+
  
  bind -r H resize-pane -L 5
  bind -r J resize-pane -D 5
  bind -r K resize-pane -U 5
  bind -r L resize-pane -R 5

I read Brian Hogan's 2012 edition of "tmux: Productive Mouse-Free Development". It was short and made me comfortable enough with tmux that since then I rarely ever use the terminal without starting a tmux session first. I see now that the book has been revised in 2016 for tmux 2 and perhaps I'll re-read it to see what I've missed.

Re: Getting Started with Tmux

#72
post #68

Earlier quoted context omitted.

Byoby looks good, though I never use function keys. I like to keep (almost) everything as close to the homerow as possible, so I don't think I'll ever abandon tmux. For example, to jump to specific windows within a tab, instead of number keys, I use `cmd-a`, `cmd-s`, `cmd-d`, `cmd-f`, `cmd-q`, `cmd-w`, `cmd-e`, and `cmd-r` for windows 1-8 respectively (I don't have one for 9 since if I ever get past 8 windows, they a…

The main reason for having function keys is that you can have their labels on the screen, and that's intuitive. You can see it with IBM's CICS. Otherwise they are not that useful, and you can see it in eg laptops making Fn a secondary function, with the primary being adjustment of brightness or volume.

Oh ya, I'm not against function keys or anything, just not for me. Switching to vim 10+ years ago made all my RSI problems go away so now I just like to keep my fingers on the letter keys as much as possible. I don't even like stretching to number row when I can avoid it (though I do all the time, of course).

Re: Getting Started with Tmux

#73
post #5

I've only used tmux for about One of my favorite scripts to run is a tmux script that creates a new session with about 7 windows of running my company's project (one window for notes, 3 windows for the backend (runner, code, tests), and 3 windows for the client (runner, code, tests). It's even tweaked further to open up the code in vim, and when used in conjunction with something like harpoon.nvim I have access to my…

This is exactly how I was introduced to tmux and learned to love it. Joined a web dev company who’s workflow was to start a swath of back-end servers each in a tmux pane. There were more than a dozen, so the tmux launch script made it simple and manageable. It’s nice to have the outputs in separate terminals, and to be able to restart them because the command’s in bash history, among many other little niceties.

Re: Getting Started with Tmux

#74
post #29

Earlier quoted context omitted.

+1 Been running my servers this way, for years.

I've only recently started running my servers this way, and I've taken this to the next level with bubblewrap: https://tobykurien.com/simpler-linux-selfhosting/

Nice! From my experience, really what you want next is a working tmux-resurrect. Or, at least, all your services runners to be in .sh scripts (and not just in your so evanescant bash history)

Re: Getting Started with Tmux

#76

I recently decided to give terminal multiplexer a try. I first used tmux for a couple of weeks and then discovered zellij. It felt much more user-friendly, but I don't know how much I am missing out in terms of useful features compared to tmux.

I like zellij, it has some bugs and seems to leak memory for me. I think it’s a it easier to get configured and set up though. Seems like it might be great one day though.

Re: Getting Started with Tmux

#77

As a heavy GNU Screen user for the last 2 decades it’s always in the back of my mind if I should be switching to tmux. Maybe there is a compatibility mode. For those who switched from screen what was the biggest benefit?

tmux can't do anything related to real serial lines. And if you do launch tmux via serial line, tmux is hard-coded to disable software flow control. Its basically for utf8-capable terminal emulators only.

Re: Getting Started with Tmux

#79

As a heavy GNU Screen user for the last 2 decades it’s always in the back of my mind if I should be switching to tmux. Maybe there is a compatibility mode. For those who switched from screen what was the biggest benefit?

Here is my .tmux.conf file. It has a small tutorial at the top of the file and also maps the PREFIX key to ctrl-a so that it feels like screen key bindings.

https://github.com/jftuga/universe/blob/master/tmux.conf

What I like about this config is the "mouse mode". When you split a windows into multiple panes, you can press ctrl-m to go into mouse mode. Within mouse mode, you can use the mouse to resize panes. Outside of mouse mode, copy/paste works better.

Re: Getting Started with Tmux

#80
post #44

Among many tricks and tips, I recommend mapping `|` and `-` to split panes: bind-key | split-window -h bind-key - split-window -v More on my wiki: https://wiki.rsapkf.org/notes/unix/tmux/

I don't use it a lot, but it's super handy to have this binding.
Post reply on HN