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

I must admit I'm a screen guy. I feel not at home when I find a system without screen and I miss the "killer feature" of connecting to any tty at any baud rate

  screen /dev/ttyUSB0 9600
in tmux. But recently I tried to switch to tmux and found a few useful configurations.

1) I have alacritty as a terminal so no scrollback and no tabs (yeah there is a scrollback branch, but why duplicate functionality?) So my default setup right now is that alacritty (I use i3 so alacritty is bound to meta+enter) opens with this line (this way only one terminal can be opened and has always the same state)

  tmux attach -d -t alacritty || tmux new -s alacritty
So I got scrollback and tabs. Also I added

  bind-key -n C-t new-window
  bind-key -n C-PPage previous-window
  bind-key -n C-NPage next-window
to the config so I can use it like any normal terminal with ctrl+t (new tab) and ctrl + pgup/down to switch between them. In theory I could even add shift with (C-S-t), but this somehow doesn't work for me and I found conflicting information on it and some outdated infos so I just stopped looking.

The second configuration that I like to use is what everybody uses

2)

  unbind C-b
  set-option -g prefix C-a
  bind-key C-a send-prefix
to change the prefix to the sane ctrl+a screen default.

Also setting colors is a must for neomutt and co

  set -g default-terminal "tmux-256color"
I'm still experimenting with configs for my desktops and servers, but I'm feeling a bit more at home with tmux right now.

Oh and for anyone who doesn't know of byobu check it out http://byobu.co/ it's a wrapper around screen and/or tmux and is easy for beginners and a nice change for everybody else.




I assume people change it from ^B so it still works in vim and less - that's why I changed it - so I find the popular ^A prefix particularly baffling, given how useful it is with programs that use readline i.e. every shell.


I do the same thing to auto open tmux and block any new windows from being created. If there is one, it instead opens a new tab when I run my hotkey (ctrl+alt+t). I have shift+arrows to switch between panes, and ctrl+a C to create them.


Just out of curiosity why is ctrl+a more sane than ctrl+b?


Like I said I'm a screen guy so I'm used to ctrl+a and I got my keymap remapped so that caps lock is ctrl so ctrl and a are right next to each other b is in the middle of the keyboard and I find it irritating having to press ctrl and b.

Also I don't use ctrl+a but the home key so I'm missing nothing.




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

Search: