Live data from Hacker News

Benefits of using tmux – streamlining your development environment

blog.bugsnag.com

141–150 of 172 posts

Re: Benefits of using tmux – streamlining your development environment

#141

I started writing a terminal multiplexer in Rust, partially because I wanted to fix clearing ANSI escape codes to EOL, but also because I wanted to try and come up with a multiplexer that had very similar shortcuts and commands to Vim.

That sounds like an interesting project.

Another approach might be to use NeoVim which now has a built in terminal emulator. [1]

[1]: https://neovim.io/doc/user/nvim_terminal_emulator.html

Re: Benefits of using tmux – streamlining your development environment

#142
post #62

To me tmux, like a lot of tools, suffers from bad defaults that makes it less enjoyable to use. One example is not being able to scroll with a mouse. I usually find someone's tmux.conf online and use it, but always run into strange problems that I don't have the energy figuring out. My current conf suffers from the navigation bar going completely black when I try to rename a pane (can't see what i'm typing). Really w…

I guess bad defaults have been chosen to maintain stability for previous users. IMHO, man pages should contain a .tmux.conf that demonstrate the "best" usage(s) of the tool.

IMHO man is the most important command in unix and "man man" the first step in learning unix.

Re: Benefits of using tmux – streamlining your development environment

#143

If you want to get a taste of the benefits of tmux without having to learn anything new, I recommend using iTerm and setting up an alias for 'ssh [your server] -t "tmux -CC attach || tmux -CC"' Just running that command will connect to your server and attach to an existing tmux session, or create a new one if needed, and make use of iTerm's tmux integration, so you can use the standard macOS keyboard commands (or the…

Are there terminal emulators on other platforms that offer similar tmux integration?

'tmux' is actually something that runs server-side if you are ssh'ing into something, it should work with any terminal emulator the same way as GNU screen would if you ever used that, e.g. PuTTY works fine for tmux.

Re: Benefits of using tmux – streamlining your development environment

#144
I came from screen when I started using tmux. I spend quite some time to make the key bindings similar to screen, however, kept some things the tmux way because it was better. For people interested, this is my complete tmux.conf:

https://github.com/gitaarik/tmuxconf/blob/master/.tmux.conf

Re: Benefits of using tmux – streamlining your development environment

#145

Earlier quoted context omitted.

Are there terminal emulators on other platforms that offer similar tmux integration?

'tmux' is actually something that runs server-side if you are ssh'ing into something, it should work with any terminal emulator the same way as GNU screen would if you ever used that, e.g. PuTTY works fine for tmux.

I believe the parent was referring to iTerm's native understanding of tmux windows which is certainly not supported in all terminal emulators.

Re: Benefits of using tmux – streamlining your development environment

#146
post #9

Does anyone run tmux with a tiling window manager for local development? If so, what are the advantages? I know automating sessions is one of them, as explained in the article. I am more interested in hearing about interactions with the terminal. You already get good mouse-less window management with something like i3 or xmonad. How about copy & paste? I use urxvt plugin for this, but I often find myself using the mo…

I used to use i3 and tmux for a time.

Advantage (of using tmux on top of i3):

When you spin up a new window with i3, it doesn't retain the previous's current working directory. There are some hacks to make it kind of work, none of which work nicely. With tmux it just works.

tmux has synchronized panes. It allows you to send same keystrokes to multiple terminals at once. This is useful for managing multiple host machines at once, i.e. ssh'ing into different machines at checking certain logs.

Disadvantages:

Double the amount of keybindings you need: one set for i3, one set for tmux. i3 allows you to active a mode where keystrokes are 'forwarded', so theoretically you can use the same keybindings for both, although it is very annoying if you forget to active this mode since you're now creating i3 windows instead of tmux panes and have to clean them up.

Re: Benefits of using tmux – streamlining your development environment

#147
The one issue I have with tmux, versus using iterm natively, is that every single time I have to reboot my machine for an operating system upgrade, I lose all the terminal history of my tmux sessions - whereas with iterm, when the machine restarts, it restarts with the all the windows and terminal histories intact.

Its ironic that tmux doesn't provide any mechanism to save your terminal history between reboots. Tools like tmuxinator/tmux-resurrect will save your session/window/pane configs, but you lose all your history...

If I could just recover my (typically very valuable) terminal history between reboots, tmux would be the perfect tool for managing my terminal environments...

Re: Benefits of using tmux – streamlining your development environment

#148

If you want to get a taste of the benefits of tmux without having to learn anything new, I recommend using iTerm and setting up an alias for 'ssh [your server] -t "tmux -CC attach || tmux -CC"' Just running that command will connect to your server and attach to an existing tmux session, or create a new one if needed, and make use of iTerm's tmux integration, so you can use the standard macOS keyboard commands (or the…

I never knew about this. Thanks!

When I do this, it opens a new window with the "attached tmux running inside" and the old window is running in "tmux mode". Is it possible to not have a new window open, but use the window where the command is run instead?

Re: Benefits of using tmux – streamlining your development environment

#149

The one issue I have with tmux, versus using iterm natively, is that every single time I have to reboot my machine for an operating system upgrade, I lose all the terminal history of my tmux sessions - whereas with iterm, when the machine restarts, it restarts with the all the windows and terminal histories intact. Its ironic that tmux doesn't provide any mechanism to save your terminal history between reboots. Tools…

[deleted]

Re: Benefits of using tmux – streamlining your development environment

#150
I'll give a shout-out to DVTM ( http://www.brain-dump.org/projects/dvtm ) which I've been using successfully for a couple of years.

Prior to that I used tmux for a few years, and screen before that. I suppose the only compelling reason to use DVTM is that it acts like a tiling WM, so if you use one (I use XMonad http://xmonad.org ) the experience is basically the same (mod-h/mod-l to resize, mod-j/mod-k to navigate windows, mod-space to switch layout, etc.).

The main reason I switched is my preference to avoid bloat. DVTM doesn't do everything tmux and screen do, it only does window management. I use dtach ( http://dtach.sourceforge.net ) for persistence. I previously used abduco ( http://www.brain-dump.org/projects/abduco ), but it segfaulted on me a couple of times (months apart, in a non-reproducible way); haven't tried it for about a year, so it might have stabilised.

I use st ( http://st.suckless.org ) as my terminal, again to avoid bloat.

Post reply on HN