Live data from Hacker News

Tmux Tutorial

leimao.github.io

121–130 of 166 posts

Re: Tmux Tutorial

#121

I tried to use tmux as a terminal multiplexer on sway just so I could make it remember a setup of terminals for specific projects. That way I could simply do `tmux-command start project-name` and have it automatically open a setup of windows and panes. Though I found it unfortunate that I had to learn new shortcuts that are different for shortcuts elsewhere. A simple example but which was a deal breaker was in order…

Just use `bind-key -n` for a no-prefix bind

See e.g. https://unix.stackexchange.com/questions/450184/in-tmux-how-...

Re: Tmux Tutorial

#124
post #88
post #58

Earlier quoted context omitted.

Not sure why ctrl-a and ctrl-b are such popular prefixes, I use both a lot editing readline.

I definitely hear you on ctrl-a. No idea what ctrl-b does, though?

It moves the cursor back one character (which is the default readline binding). In screen's case, you can send ctrl-a to readline by pressing ctrl-a a.

Re: Tmux Tutorial

#125
post #2

I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.

not sure how screen is today but I switched to tmux because vsplits were builtin (back in the days you needed patches for screen)

screen has had a vsplit feature for several years now (ctrl-a |) in the screen package in the fedora upstream repositories.

Re: Tmux Tutorial

#126
post #48

We use tmux for remote peer programming in a pinch. If Alice has a session on a remote machine you have access to. You can run `tmux new-session -s bob -t Alice` With this both share he same view but can move cursors independently.

> With this both share he same view but can move cursors independently.

Does this mean they have 2 separate cursors, or that that can control the same cursor? Your can sort of do the same thing in screen by using a nested screen session and sharing the outer session with the other user.

Re: Tmux Tutorial

#127

Earlier quoted context omitted.

I might be missing something but how do you input character ` as is (in vim inside tmux for example) if it's bound to prefix?

I think sending double prefix actually sends the prefix to active window.

Yes, which also enables using tmux in ssh/mosh in a tmux session.

Re: Tmux Tutorial

#128

If you're on a Mac, try tmux -CC with iTerm2. You get tmux goodness like multiple panes, persistent sessions, etc. But you also get native scrolling, native copy and paste, etc. It's what makes tmux usable for me.

Iterm2 is the number one Software driving my Mac productivity besides OS X itself.

So much of it is lost because work machines have been either windows or Ubuntu. I tried a few things but nothing comes even close to the level of overview and speed you have with iterm. In the end I usually end up using multiple windows and too much mouse..

The tmux integration is just the cherry on top

Re: Tmux Tutorial

#129

For those who customize their configs and, like me, SSH into all kinds of different short- and long-lived servers regularly: How do you stay sane? I don't want to have to scp over my tmux conf to every single server I jump on, but OTOH difference in pretty much anything but the prefix gets really frustrating with habits. Particularly remembering all the emacs mode-keys when I really want the vi ones.

I use git and GNU stow. ssh in, clone the repo, stow tmux. Takes ~10 seconds on a new host. Also includes all the other dot files I use (bash, vim, etc).

Re: Tmux Tutorial

#130
post #2

I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.

If you've used screen for 10 years, learning tmux will take about 10 minutes. There's also some handy plugins: https://github.com/tmux-plugins

Really, if screen works for you, tmux isn't going to change your life. And I say this as someone who used screen for at least 10 years before switching to tmux.

Post reply on HN