
A minimalist guide to tmux - wheresvic1
https://medium.com/actualize-network/a-minimalist-guide-to-tmux-13675fb160fa
======
lloeki
I'd add <prefix> w to that list, which shows an interactive list of opened
windows which is very friendly to newcomers, does away with the base-index
setting that's needed to fix cognitive dissonance of tab order vs key order,
and circumvents the inconvenience of having to use shift to reach for numbers
on non-US layouts.

> Ctrl a (a little faster to type, doesn’t conflict with vim

... but conflicts with beginning-of-line emacs-style bindings, widely in use
in readline/libedit/zsh.

~~~
spinningarrow
C-a seems to be quite a common prefix, but as you said, it conflicts with the
beginning-of-line command. I’ve been quite happy with C-s so far; if it
conflicts with something, I have no idea.

~~~
barrkel
C-s searches forward where C-r searches backwards, if you're used to using C-r
to retrieve an earlier command via incremental search.

If not otherwise configured with stty, it's frequently set up for control flow
along with C-q. If you find your terminal freezes after typing C-s, C-q will
unfreeze it.

Disable with:

    
    
        stty -ixon start undef stop undef

~~~
spinningarrow
Thanks, I didn’t know that! I use the fish shell, which does history searching
differently but this is useful for those few times when I’m in bash.

------
majewsky
> Let’s say you’re using vim to edit code on a remote computer using ssh, and
> you want to open a new terminal tab to start a development server.

vim 8 has a built-in terminal.

    
    
      :terminal ./start-development-server.sh --port 8080
    

will open a new buffer in a split window that executes the given command line.
And it even supports all the regular vim keybindings.

    
    
      :help terminal.txt
    

for details.

~~~
closed
Thanks for sharing this! Vim is the kind of tool I use all the time, but never
check for new features. Will definitely use :terminal all the time now :).

(For anyone interested, it looks like only more recent releases of vim 8 have
:terminal.)

~~~
majewsky
Yes, it was added only recently after Neovim showed the idea of terminal
buffers to be feasible.

So it may not be available on $random_rhel6_server, but since the article
described the scenario of a development server, I figured that package
versions on there should be fairly recent.

------
j_s
Of all the previous tmux discussions, the most practical help was given when
this article was discussed 2 months ago:

[dupe]
[https://news.ycombinator.com/item?id=15776995](https://news.ycombinator.com/item?id=15776995)
(267 points, 96 comments)

Surprised to see it again so soon -- darn you Medium flexible URLs!

PS. Anyone willing to earn $400 implementing mosh ssh port forwarding
[https://www.bountysource.com/issues/4471419-ssh-port-
forward...](https://www.bountysource.com/issues/4471419-ssh-port-forwarding-
doesn-t-work), or should I move on to the mentioned alternative
[https://mistertea.github.io/EternalTCP](https://mistertea.github.io/EternalTCP)?

PPS. Bountysource feels sketch:
[https://hn.algolia.com/?query=bountysource](https://hn.algolia.com/?query=bountysource)

~~~
AlexCoventry
ET might be insecure. It has recently been easy to segfault with network
traffic.

[https://github.com/MisterTea/EternalTCP/issues/79](https://github.com/MisterTea/EternalTCP/issues/79)

------
Jtsummers
A while ago I saw comments here about tmuxinator. Which was a fantastic
improvement to my tmux use. Create a layout manually, get the layout from tmux
and then set it up to launch a custom set of windows, panes, and programs
based on my project needs. Doing this easily and repeatedly makes it trivial
for me to set aside a task and come back to it later and be confident I will
have everything in view that I need.

[https://github.com/tmuxinator/tmuxinator](https://github.com/tmuxinator/tmuxinator)

~~~
lloeki
Should you have to reboot, this related tidbit can come in handy:
[https://github.com/tmux-plugins/tmux-resurrect](https://github.com/tmux-
plugins/tmux-resurrect)

------
pletnes
Tmux is awesome. Although I never understood why they used ctrl-b instead of
ctrl-a as the default though - incompatible with screen and hard to reach with
one hand.

~~~
notinventedhear
Probably since ctrl-a is a well-loved bash shortcut for goto start-of-line.

~~~
AnIdiotOnTheNet
I assume that shortcut predates the existence of the Home key? Maybe we can
let it die.

~~~
spinningarrow
I hope not. I actually find C-a and C-e (for end) _much_ easier to type,
especially with Caps Lock remapped to CTRL.

~~~
AnIdiotOnTheNet
And my own personal muscle memory prefers a different setup, so that's why
these things should be configurable, but the defaults should probably match
common conventions don't you think?

------
brudgers
Previous discussion,
[https://news.ycombinator.com/item?id=15776995](https://news.ycombinator.com/item?id=15776995)

------
JepZ

      # remap prefix from 'C-b' to 'C-a'
    

Still hate the tmux devs for that default value, but hell there is so much
good they did, so I can forgive them that :D

~~~
empthought
C-a is a non-starter for people who use Emacs/OS X key bindings for move-
beginning-of-line.

~~~
simtel20
C-b is pretty bad for the same reason for users like me with with well-worn
emacs key memory. I end up using the backtick, but it does make sharing a
session that little bit more difficult.

------
jxdxbx
tmux always seems kind of cool but I have a hard time seeing an advantage over
just running multiple terminal windows, using mosh if remote.

~~~
spinningarrow
Being able to bring up my shell session if I accidentally quit the terminal
emulator has been a really helpful feature for me.

------
psychometry
I could never get into tmux since it doesn't play nicely with iTerm2 and the
mouse. With iTerm2 panes, you can select/copy/paste text within the pane even
if it's over multiple lines. In a tmux session, you select all text across all
panes.

Ditto goes for scrolling: Native windows scroll more naturally than tmux with
mouse support.

~~~
dhimes
Agree- this is a "pain." When I want to select text I make all panes
horizontal. Not elegant, but it works. Then I put them back.

------
baby
Took me a while to figure out why I had to press C-b twice to go back in
emacs. Reconfigure your tmux prefix ;)

~~~
agumonkey
I had "fun" nesting ansi-terms with tmux sessions of emacs in emacs (as you
do).

so much quinning

~~~
baby
C-b C-b C-b C-b. Oh my... happened to me too. I think this is when I finally
understood what was happening.

------
metalliqaz
I've never used tmux because I've always used screen. Is there a reason to
drop screen for tmux?

~~~
nameless912
Two words: vertical splits.

------
ohazi
Apparently I'm the only one who doesn't mind ctrl-b as the prefix.

------
iAm25626
been using mosh + tmux for couple years and it's been great. Amazing how a
tiny bit of work flow improvement increase productivity.

------
beagle3
Highly recommended: byobu, a screen+tmux configuration that works well and is
available on Ubuntu and in other places.

------
raptured
Awesome Guide. Definitely liking the move to tmux!

------
snag
my minimalist guide to tmux : I use byobu.

