Remix.run Logo
boredtofears 5 days ago

To throw gasoline on the fire: this how I’ve always felt about tmux. Why use an incomplete in terminal windowing system when I can just have multiple terminal windows open managed by the superior OS window system.

(That said I know tmux is sometimes the only option and then it makes sense to me)

cturner 5 days ago | parent | next [-]

I tend to run my tmux session for months at a time on my office workstation. When I remote in to that computer, I can type ‘tmux attach’ and all my context is there. I might have four long arc dev projects running at once, and my planning system, all within those windows.

On our datacentre servers, I also have tmux running. It is fast to connect to these hosts, attach tmux and continue from where I left off.

Another use case: it is common for corporates to require devs to use windows desktops, but to then give them a headless linux host in a datacentre for development work. Here, you use putty to connect to the linux host, fullscreen it, run tmux. On your desktop you have outlook and office and putty and a browser and no dev tools. You can do all your planning and dev work on the linux host, using your favourite ten thousand hours text editor and building your own tools, and this becomes your hub. You lose awareness that you are connected to this from a locked down windows host. Corporate security reboots your windows host for patching several nights in a row, and it does not cause you any hassle because your work context is in the tmux session on another host.

Twey 4 days ago | parent | prev | next [-]

The difference is that tmux, with all its state, typically runs on a remote system. The graphical equivalent would be a VNC &c. session, assuming that the remote machine has the prerequisites for that (which is a pretty big ask).

kurisufag 5 days ago | parent | prev | next [-]

tmux (and screen) are incredible assets for remote sessions, both for continuity across dropped shells and multi-shell activities when the connection process is tedious (multiple jumphosts, proxies, etc.)

jauntywundrkind 5 days ago | parent | next [-]

I've fallen out of using it, but for a while I was using dtach to do similar without the virtual terminal multiplexing. Much much more direct.

I'd just run a vim session. If I needed terminals, they were in my vim! Even wrote a short shell-script to automate creating or re-attaching to a project specific vim session. https://github.com/jauntywunderkind/dtachment

Haven't looked into it, but I'm love a deeper nvim + atuin (shell history) integration.

iiyama 4 days ago | parent [-]

It might be quite similar window/tab managing functionality, but for me it's the same thing that made me choose tmux over screen: it comes with a nice status bar as default and hotkeys are somehow easier to memorize.

jauntywundrkind a day ago | parent [-]

My dtach+nvim uses nvim as terminal multiplexer & "status bar", which is pretty ok! Dtach only serves as a very very dumb pass through (where-as tmux really is a persistent virtual terminal that clients can read-out from).

o11c 5 days ago | parent | prev [-]

The continuity benefit is much less than it used to be, now that we have systemd with `enable-linger` so we can make proper daemons.

em-bee 5 days ago | parent [-]

that's not what tmux provides continuity for. the continuity is for interactive sessions. on my server i have more than 20 tmux windows, each one for one specific purpose. they have been running for several years.

o11c 4 days ago | parent [-]

My point is that a lot of hysterical-raisin interactive sessions really don't need to be.

em-bee 5 days ago | parent | prev | next [-]

because the OS window manager isn't superior. i have two dozen tmux windows in half a dozen sessions locally. i have shortcut keys to switch between sessions and between windows. i can do that while mixing the terminal with other gui apps. i have yet to find a window manager that lets me group so many terminals into sessions all on the same workspace.

jolmg 5 days ago | parent | next [-]

> i have two dozen tmux windows in half a dozen sessions locally.

> i have yet to find a window manager that lets me group so many terminals into sessions all on the same workspace.

Locally-speaking, I don't really see the point of mixing tmux sessions and tmux windows. I wonder if you mean "sessions" -> tmux windows and "windows" -> tmux panes.

What about i3/sway? You can have a tabbed container (functions like tmux windows) with split containers inside (functions like tmux panes). You can even float the tabbed container with all windows organized inside.

em-bee 4 days ago | parent [-]

I don't really see the point of mixing tmux sessions and tmux windows.

sessions let you group windows. i have a group/session for each project/purpose. one session is for all remote connections. one for my personal stuff, diary, etc. one for my hobby. one for personal dev projects, one for client work.

sessions also means that i can connect to tmux from multiple terminal windows. i generally have two windows, one for dev work and one for everything else.

generally i feel that having more than half a dozen windows in a session makes the session unwieldy, harder to navigate, because it becomes more difficult to find the window i am looking for.

which would be the same problem if each was a gui window. try to find your way around 20 gui windows.

codethief 4 days ago | parent | next [-]

> one session is for all remote connections. one for my personal stuff, diary, etc. one for my hobby. one for personal dev projects, one for client work.

Why would you have all those open at the same time, though? Isn't that incredibly distracting? (Disclaimer: I have no experience with tmux to speak of, beyond briefly trying it once or twice.)

em-bee 4 days ago | parent [-]

not being distracted is the whole point. if i have everything in a window, then i would have 20 windows. that would be distracting. with tmux i only have one visible window and all other windows are hidden, and i switch to the window i want to use. (ok, i could do that with gui windows too, i am just making a point)

these things are open because otherwise i would have to open them and close them every time i want to use them. by keeping them open i can switch back and forth faster. but, while i am not using them they are invisible. and i don't notice that they are there.

jolmg 3 days ago | parent | prev [-]

> generally i feel that having more than half a dozen windows in a session makes the session unwieldy

> which would be the same problem if each was a gui window. try to find your way around 20 gui windows.

I mean, just like how you can organize tmux windows in tmux sessions, you can organize gui windows in workspaces and containers to arbitrary depths.

em-bee 2 days ago | parent [-]

you can organize gui windows in workspaces and containers to arbitrary depths

which GUI offers that? i have only ever seen a single level: workspaces and windows and tabs. that's not enough.

by using tmux i get those three GUI levels and the three levels of tmux

jolmg 2 days ago | parent [-]

> which GUI offers that?

The ones I mentioned: i3/sway. There's probably other tiling WMs that similarly allow organizing windows into trees of containers of arbitrary depths. The containers being able to be set into 4 different modes for displaying the containers/windows within: split horizontal, split vertical, tabbed, or stacked.

em-bee 2 days ago | parent [-]

very well, thanks. i'll give that a closer look.

5 days ago | parent | prev | next [-]
[deleted]
boredtofears 5 days ago | parent | prev [-]

I just logically group tabs into the same terminal window. All OS's have hotkeys for switching between tabs and windows.

em-bee 4 days ago | parent [-]

sure that works, but then you are also using terminal functionality and not the window manager, which still shows the window manager as lacking in features, which was the argument i was responding to.

seriously, a window manager that can group windows and manage those groups would be awesome. workspaces help, but they are often just there, and can't be managed, reordered, named, etc..

actually, i think kde may have some of that functionality.

i still prefer tmux in any case because it is more scriptable, and it provides a detach function. although i recently started exploring wezterm, which can be configured to work like tmux and also has a way to detach and reattach sessions: https://news.ycombinator.com/item?id=44762241

MobiusHorizons 5 days ago | parent | prev | next [-]

I would typically not bother with tmux unless ssh is involved.

4 days ago | parent | prev [-]
[deleted]