Live data from Hacker News

Getting Started with Tmux

ittavern.com

51–60 of 160 posts

Re: Getting Started with Tmux

#51

My favourite tmux trick only works on an apple gb keyboard: set -g prefix ` bind-key e send-prefix Then, all your tmux controls are one left pinky press away (` is beside z on uk Mac keyboards). (`e sends a ` for when you need it, rare though, $() is better for sub shells :})

I use backtick as my prefix as well, plus 1-indexed window numbers. I guess it's a bit farther away than yours, but it's still wonderful.

Re: Getting Started with Tmux

#52

I use iTerm locally and tmux on a dev instance and it's great. The built-in tmux integration[1] is a pleasure to use. On my end, I see a terminal with tabs; if my ssh connection drops, I can just reconnect and magically all the tabs and their states are persisted. In lieu of this integration, I enable the tmux mouse mode which lets me highlight text with the mouse, navigate around splits by clicking in them... great…

does the integration work fully with tmux key commands?

Re: Getting Started with Tmux

#54
post #15

My favorite mod is something simple as renumbering the windows/tabs to range starting at 1, rather than being zero indexed, this way they align with the digits on my keyboard.

yeah, this helps immensely. I also remap the leader key to backtick so that it's a single handed, two-key motion to switch windows.

Re: Getting Started with Tmux

#55

My favorite antipattern is, you can just leave a script that does an event loop running in the foreground, detatch tmux, and voila, you have a 'server'. Works great in a pinch or when you just don't need to finish it.

Add it within a infinitive loop + `sleep 10` and now it automatically restarts if it crashes too! :)

haha, exactly what I've been doing (yes, sleep 10 as well!) I also added bubblewrap for security and wrapped it all up in a nice script to list/stop/start services, see https://tobykurien.com/simpler-linux-selfhosting/

Re: Getting Started with Tmux

#56

My favorite antipattern is, you can just leave a script that does an event loop running in the foreground, detatch tmux, and voila, you have a 'server'. Works great in a pinch or when you just don't need to finish it.

Also been doing this for years. And always wondered about possible disadvantages, or is there any reason why it is not used like this by everyone?

Re: Getting Started with Tmux

#57

I've used Tmux/Screen the few times I've had to be in an actual terminal, but don't really see the use for them when using a GUI terminal emulator. I just open new tabs or (rarely) windows as needed. Could anyone using these explain what it provides that you find useful in practice? I rarely ever need persistence of shell when I close the console, is that a common need? Familiarity/muscle memory of shortcuts is a val…

Working locally: When you want multiple windows configured more compactly or more customization than any gui emulators. But it really shines for remote work where you’re not running a vnc, where u have a persistent terminal session, maintain all windows etc if you get disconnected.

Re: Getting Started with Tmux

#58

I've used Tmux/Screen the few times I've had to be in an actual terminal, but don't really see the use for them when using a GUI terminal emulator. I just open new tabs or (rarely) windows as needed. Could anyone using these explain what it provides that you find useful in practice? I rarely ever need persistence of shell when I close the console, is that a common need? Familiarity/muscle memory of shortcuts is a val…

I use tmux in a GUI terminal emulator (KDE's Konsole) for a force of habit. It's nice to have split views, tabs and sessions, though Konsole offers tabs and splits, but it's nice to have them when you need to go to a TTY and having your session running there too as if nothing had happened.

Re: Getting Started with Tmux

#59
post #3
post #2

I've been using tmux daily for more than a decade and didn't know prefix+! converted a pane to a new window.

I recommend to everyone, if you are using a tool regularly, take half an hour of time to study its man page. This way you'll learn about all the things that your tool supports but you haven't been aware of yet.

I agree, and would like to add: do this once in a while with all your tools, even ones you have read the manpage for. Even ones you have a high level of proficiency in... New features get added that you might miss. When you first read the manual there's a good chance you either missed something or didn't understand how cool feature xyz is (e.g. because it's a feature that only makes sense once you are proficient with the basics).

Re: Getting Started with Tmux

#60

One of the best software I've ever used, it's addictive. Did anyone manage to get it set up on windows? And if you did is it buggy or does it run smooth?

I use TMUX all the time inside Gitbash for Windows. Some panes are SSH sessions into Linux servers etc. While other panes I use vim to edit local Windows txt files or just run other local Windows things. (This mightn't be what you were looking for)

If I could get that in cmd and powershell it would be perfect. I have to use cmd at work. I use gitbash for other stuff like you do but cmd is where I really need tmux.
Post reply on HN