return to table of content

Show HN: Shpool, a Lightweight Tmux Alternative

randomtoast
19 replies
1d4h

A lightweight tmux alternative? Tmux is already an incredibly lightweight C program in terms of binary size and resource usage.

CyberShadow
5 replies
1d3h

tmux takes over scrollback, so it's not possible to scroll the buffer in the same way as without tmux. This tool seems to solve the problem more elegantly.

ethanpailes
2 replies
1d3h

tmux does support scrolling and copy-paste, but they often work subtly differently than the way they do in a native terminal. For example, when I try putting `set -g mouse on` in `~/.tmux.conf`, scrolling mostly works fine but if I scroll up and then start typing or press up, I won't jump right to the bottom of the session the way I'm used to in native Alacritty (which I will often do as a way to return after scrolling back through a bunch of print output). This isn't a huge deal, and you can definitely get used to it, but it can be frustrating if you like how your normal terminal emulator works and don't want it to change.

whalesalad
1 replies
1d

nothing in life is free, what do you honestly expect?

bobthecowboy
0 replies
22h30m

This is kind of a strange comment to leave to the author of the tool that's being compared...

Obviously "nothing in life is free" - the person you're replying to literally spent a bunch of time writing a solution to their problem.

"what do you expect?" - the person literally wrote what they expected after having written the code to do exactly that. OP has been all over this thread being incredibly diplomatic in both explaining why they wrote a replacement for (part of) tmux, and constantly following it up with "but by all means if that doesn't sound right to you, use tmux it's a great tool".

It feels a lot like "well, if you don't like it go do it yourself", which is deeply ironic.

cstrahan
0 replies
1d3h

That gets you scrolling, yes, but not in the same way as without tmux.

Without tmux, your terminal emulator uses its scroll-back buffer to render as you scroll, not requiring any intermediate copies of the lines of text scrolling into view.

With tmux, your terminal emulator no longer handles that, and instead tmux must pass a copy of each line freshly scrolled into view to the terminal emulator, which involves an intermediate copy of that text and re-triggers the terminal emulator’s parsing (as far as your terminal emulator is concerned, it has never seen this line of text yet). All of that (and some other subtle overhead I’m not mentioning here) are completely avoided outside of tmux (or more specifically: whenever the terminal emulator is free to manage its own scroll-back).

hnlmorg
4 replies
1d3h

I assumed they meant “lightweight” in the sense that tmux can take quite a bit of setup and practice to get comfortable in, when using for the very first time.

I love tmux but it’s definitely not “n00b” friendly.

MuffinFlavored
3 replies
1d3h

$ tmux

# run your command in it

# Ctrl+b D to detatch

later, to attach back to it

$ tmux a -t 0

That probably covers 50% of usage. The rest would be naming the sessions, splitting the window panes. Anything else?

Tyr42
1 replies
1d3h

Scrolling.

That's a key feature when you don't reflexively use less and ] isn't a natural keybind for "let me scroll please".

pawelduda
0 replies
1d2h

Also search, copy-paste

hnlmorg
0 replies
1d1h

Yes.

Window management, mouse support, key bindings (I really dislike the defaults for a few of them), selection/copy/paste, macros etc

All stuff that doesn’t need to be configured but if you look at any tmux tutorial you’ll see boat loads of details about. Which can be confusing because how do you know if you don’t need to know it?

Also what’s the basics for one person isn’t going to be the basics for another. Eg I rarely use the detach capabilities these days whereas the panes and windows are something I do use lots.

My point is this: tmux is sufficiently complicated that a complete beginner might not know what features they need to learn.

ethanpailes
3 replies
1d3h

Yeah that's a good point, "lightweight" was probably not the best term. I meant lightweight in terms of the cognitive overhead of picking up a new tool, not really in terms of performance. I would expect that shpool will perform better on some workloads and tmux will perform better on others (though in both cases they are probably good enough).

The main difference is that tmux is a power user tool that you generally invest in configuring and tweaking to get just right, while shpool is meant to be set up quickly to solve the specific problem of dropped connections and then mostly forgotten about.

brisketbbq
1 replies
21h39m

Does this mean you don't plan on taking any ideas from screen/tmux and implementing them in your tool?

ethanpailes
0 replies
18h34m

Well potentially some, but definitely not tiling and screen splitting.

freedomben
0 replies
1d3h

Interesting thanks. I interpreted "lightweight" to mean available features. i.e. just the persistent connection, none of the other bloat[1].

[1]: to be clear, I don't mean "bloat" in a negative way. I'm a long time tmux user and I love it, absolutely love it, and won't be giving it up anytime soon. I don't personally think it has any bloat. But, I use the features. If one only wanted persistent connections, then all of tmux is quite a bit of bloat. It's all perspective.

jacknews
1 replies
1d3h

lightweight in terms of features of course.

it simply allows you to have multiple shell/term sessions on a server and be able to switch between them from any terminal. Kind of a 'flat ctrl-Z' cum 'nohup' if you will.

No windows, splits, etc, no client software at all in fact.

wkat4242
0 replies
1d3h

Oh thanks for checking, then I'll leave this. Splits are my primary feature in tmux.

bjoli
1 replies
1d3h

Lightweight in terms of speed. Tmux makes even the slowest terminal feel like a Ferrari.

People say the use the likes of alacritty for the speed, and then they run tmux and make it slower than even gnome-terminal.

kreetx
0 replies
1d3h

How about calling it "fast" then?

mikenew
16 replies
1d2h

This is awesome! I hate the way tmux hijacks so much of my terminal's behavior (scrollback, seaching with escape-/, etc.) and I've been looking for something like this that will manage persistent sessions without any extra nonsense.

BTW I think your readme shouldn't just characterize it as a resumeable ssh tool. I often need to start a long running process that I want to reconnect to later, or I want to put some always-on system service inside a tmux container so I can easily jump in and see logs or mess with things in one way or another. There's a lot of utility besides just handling network dropouts.

ori_b
7 replies
1d

The thing is that without hijacking it and passing it through, you can't have nice things like handling resizes, supporting attaching with multiple terminal emulators, or reconnecting to applications that make heavy use of terminal escape codes, because all of those set up persistent state in the terminal emulator.

As a result, any tmux-like layer needs to emulate a console in order to get a view into the state, and then re-render that emulated console on attach to restore state to the terminal emulator that you're connected from.

From the readme, this tool does that, kinda. I'm actually confused about why they'd go to the effort of implementing a VT100 emulator, write the code to redraw the screen from it, and yet not bother with doing the work that would let multiple terminal emulators attach.

This feels like it sits in a weird place between simple, crude tools like dtach, and tools like tmux; shpool has done most of the work to implement tmux-style behavior, and then decides to cut weird corners.

ethanpailes
6 replies
1d

You definitely don't need the in-memory terminal emulator to handle resizes or allow attaching with multiple local terminal emulators, since dtach does both and does not have an in-memory terminal emulator.

I'm actually confused about why they'd go to the effort of implementing a VT100 emulator, write the code to redraw the screen from it

Well, we kinda cheated here. shpool_vt100 is just the already existing vt100 crate with a single critical bug fixed, so it actually wasn't much work :). Turns out having a nice package manager for a systems language comes with some benefits.

I'm actually open to adding a feature to allow multiple simultaneous connections to a single session. I never really had a usecase for it personally so I haven't prioritized it, but it is something that similar tools support and people keep bringing up. Since this isn't the first time I've heard people talking about it, I just made https://github.com/shell-pool/shpool/issues/40 to track work adding the ability to attach multiple clients to the same session.

This feels like it sits in a weird place between simple, crude tools like dtach, and tools like tmux; shpool has done most of the work to implement tmux-style behavior, and then decides to cut weird corners.

I'm not aware of any tool that does internal rendering and subsetting handling scrollback and copy-paste in a way that I personally find usable, so these decisions were very much intentional.

I think tmux is a great tool for a lot of people, and I tried to get into it for years, but I could just never get over the weird scrollback and copy-paste issues or the fact that it meant that I couldn't use my normal `i3`/`sway` bindings to switch between terminals inside a tmux session. If tmux works for someone, I think that's great and they should keep using it. shpool is meant for people like me who aren't very good with computers :).

mkhnews
2 replies
19h8m

Hi. Nice kit. > I couldn't use my normal `i3`/`sway` bindings to switch between terminals inside a tmux session Just curious, what are your normal 'i3'/'sway' bindings that you cannot get to work with tmux ? And what actual terminal program do you use ? Perhaps tmux wants more config than most people care to bother with, but scrollback and copy-paste can be configured just as you like.

ethanpailes
1 replies
18h30m

If you’re using a tiling window manager your window switch keybindings necessarily conflict between the manager and tmux, since if you configure the same one and then press it while focused on a tmux window, the tiling window manager will override tmux and claim the event.

Scrollback and copy paste cannot always be configured as you want. I’ve shared some specifics elsewhere in this thread.

mkhnews
0 replies
15h54m

Hi. ok, I get that. Maybe something like A-left to move to next i3 window and A-S-left to move to next tmux window within an i3 window ? Perhaps a tiling window manager with multiple windows combined with tmux dividing some of those windows further into sub-windows isn't an ideal flow.

bee_rider
2 replies
23h49m

I’m not sure what the popular use case is for multiple connections to one multiplexer. But, two (niche seeming) ones could be: if you have a desktop, you want to be able to SSH to it and use it locally at the same time. Or, if you have two people ssh-ing to one system, and letting them share a terminal might be nice (although in that case it would really be nice to give them independent cursors, which starts to become an involved project).

Jtsummers
0 replies
21h51m

Or one person ssh'ing to the same remote from two or more devices. If I don't feel like sitting in the office (desktop) and grab the laptop and go to the sitting room or back deck I can continue my session without issue, and then transition back later. I don't want to have to disconnect/detach a session when I do this, I want it to be seamless so both connections (actually three typically, an iPad as well) are running continuously.

Geezus_42
0 replies
21h50m

I usually have a drop down terminal that I use the most, then a full screen window on some other space. I can switch between them quickly and connect to any of my sessions from either.

cookiengineer
3 replies
19h54m

Do you know mobile shell (mosh)? [1]

Seems like most of the features you need are what mosh offers. I've been using it for a decade, probably, and it is pretty awesome for latent mobile connections (read as: throttled 2G @16kBit/s with interruptions).

https://github.com/mobile-shell/mosh

KolenCh
1 replies
19h6m

I think mosh first appeared in 2012? How can you have been using it for decades?

cookiengineer
0 replies
18h21m

Sorry, mobile typo. Been using it since around 2013.

sandreas
2 replies
1d

I think you would love zellij[1]. Go check it out, it is awesome.

1: https://zellij.dev/

DEADMINCE
1 replies
22h7m

I just started using this and it is indeed awesome. Only thing I need to figure out how to do is make a tab truly full screen. It's much nicer, more intuitive, has more built in support for things and is super lightweight. It's great.

eliaspro
0 replies
7h20m

The most fullscreen it can do:

- CTRL-p, f (regular fullscreen)

- CTRL-p, z (zoom/remove borders)

clepto
0 replies
21h12m

I once had a VPN utility that HAD to be closed with a Keyboard Interrupt in order for it to shut-off properly, so my systemd setup for it didn’t work. I ended up making bash aliases for tmux commands to run it and send the keyboard interrupt signal into it to stop it. I’m sure there was a way to do this with systemd, but tmux was easy, if a bit jank.

superfish
11 replies
1d2h

I super duper highly recommend iterm2 (macos) + its integrated tmux support. It was relatively popular in my circles at google when I was there.

It comes with this tool’s benefit of native scrolling/cp paste PLUS the huge benefit of “right click to split vertical/horizontal”.

linsomniac
3 replies
1d2h

On that front: I've been using wezterm which includes a built-in tmux+mosh functionality, and it works quite well. It gives you first-class scroll/copy/paste management and multi-windows, plus session re-attachment. Probably 50% of my use of my mac is just SSHing in to my Linux box, and wezterm works great for that.

KolenCh
2 replies
18h55m

Last I tried there’s 2 major limitations, one is that the version on both ends has to be compatible, another is that it seems the wezterm at the host must be available in the system default PATH. This makes it hard to adapt to arbitrary remote systems that you have limited control of. Tmux+mosh doesn’t have these limitations (well I’m sure the mosh client and server must be compatible to each other but given it is so stable that the last 2 updates are 5 years apart there won’t practically be any problems).

linsomniac
1 replies
5h20m

Yes, the versions between client and server do need to be in lock-step. As far as needing to be in the system default path, I haven't run into that: when I initially started using it, I had dropped the executable into ~/bin and that seemed to work (that is in my shell path).

KolenCh
0 replies
3h58m

It depends how the rc files are initialized though. I remember last I check I couldn’t get it work on one system (that I don’t have control over those in /etc and those set in my home is not initialized at that stage.)

Mosh implemented a flag to include in the client side: —server=… which solves this problem.

setopt
2 replies
1d2h

The `tmux -CC` is pretty dope. I’m still surprised that not more terminals have picked it up yet.

Most GUI features (new tab, new split, scroll, search, copy/paste, etc.) just work, and it all syncs with `tmux`.

Be aware though that it can be a bit buggy if you have a fancy `tmux.conf`, and that if you rely on any `tmux` plugins then most of those simply won’t work.

thayne
1 replies
1d1h

I'm especially surprised that tmux itself can't be used as a client of a remote control mode session.

It is pretty annoying that the only terminal that I know of that supports tmux control mode only works on mac.

mtlmtlmtlmtl
0 replies
1d1h

I looked into this at one point. IIRC it turns out control mode was only added to tmux by the iterm2 dev, for use in his own project. So I guess he didn't care about adding support to tmux itself.

ibejoeb
1 replies
1d2h

The last time I used it, which was probably pushing 5 years ago, it was a big drain on the battery. It was enough that I went back to Terminal.app. Anyone else experience that? Has it improved?

setopt
0 replies
1d2h

I believe iTerm2 has been GPU accelerated for some years now which probably helps. I’ve only been using it for 3-4 years and haven’t had this issue.

mdaniel
0 replies
1d1h

Don't overlook the awesome "automatically bury session" option, which hides the "actual" iTerm2 window running the tmux control plane: https://iterm2.com/documentation-buried-sessions.html and this is the preference I mean: https://github.com/gnachman/iTerm2/blob/v3.5.2/Interfaces/Pr...

I also have dedicated .ssh/config entries for ensuring that ssh connects directly to tmux:

  Host whatever-mux
    Hostname whatever
    RequestTTY yes
    RemoteCommand /usr/bin/tmux -u -CC att

ledauphin
0 replies
17h24m

can I still use my keyboard shortcuts for switching between sessions and windows within the session?

I am much happier with that muscle memory than whatever the iterm shortcuts would be.

eigenvalue
10 replies
1d3h

nohup is also useful for this situation, but a lot of people don’t seem to know about it!

tasuki
8 replies
1d2h

Does nohup allow attaching back to the session? That seems to be the primary use case of shpool.

eigenvalue
4 replies
1d2h

No, it doesn't let you attach back, it just keeps a command going after you've disconnected your session. But if you have good logging that might be good enough.

chaps
3 replies
1d1h

Or use GDB to change stdin/stdout of the nohup'd process to the current shell!

chaps
0 replies
12h54m

Probably!

krupan
0 replies
1d

lol!

threePointFive
2 replies
1d2h

Nohup still attaches to the terminal's stdin/out/err. If the process is known to be non-interactive, redirecting to log files should be sufficient (tail -f to "reattach"). If it does expect interaction, creating a fifo file to redirect stdin from should work, but I've never tested it.

rangerelf
1 replies
1d

nohub doesn't attach nor redirect the stdin/out/err, it intercepts the HUP signal that apps receive when their controlling TTYs are disconnected.

Implying "tail -f $LOGFILE" is akin to tmux reattaching to a console is a stretch.

zbentley
0 replies
23h53m

As the sibling comments show, nohup does occasionally have sharp edges re: sharing/inheriting std* streams. I've also encountered inconsistencies when using nohup with lots of different users' shells (academics of wildly variable technical skill levels, shell environments/customizations, and opinionatedness levels): what, exactly, does it mean to be backgrounded per "&"? Does nohup+& sufficiently background all types of shell jobs (answer: no--and some of those jobs even make sense to use with nohup)? Can configs in {ba,z,da,k,fi}sh change the job control behavior so that "forgetting" jobs malfunctions under nohup (if that's possible, your users will do it, I've found--and then defend their bizarre choices until you give up and move on)?

In those cases, I've found dtach to be slightly more reliable than nohup. Frequently I'll try one and switch to the other. Less frequently, I'll correct users' configs/workflows that are necessitating the troubleshooting in the first place. Even less frequently, I'll dig into what was actually the issue :)

https://linux.die.net/man/1/dtach https://dtach.sourceforge.net/

nrh
8 replies
1d2h

I'd love to try this, but most of the places that I would want to use it are servers, and the rust requirements are way beyond where debian-stable lives.

Too much hassle to muck with backports and package pinning for a QoL tool - my feedback would be to try to make this install without tomfoolery on the stable branch of major distros.

krunck
2 replies
1d

I had to do this:

  git clone https://github.com/shell-pool/shpool.git
  cd shpool
  sudo apt install libpam0g-dev
  # you may need to install build-essential and other packages too as the
  # build-depends field in debian/control is incomplete 
  dpkg-buildpackage -b
  sudo apt install ../shpool_0.6.2_amd64.deb
  systemctl --user enable shpool
  systemctl --user start shpool

nyolfen
0 replies
18h3m

i had to `dpkg-buildpackage -b -d -us -uc`

berkes
0 replies
20h43m

And the most demanding part of that listing can be done on a build machine.

This benefit of compiled languages is often overlooked by folks who are (mostly/only) familiar with dynamic languages like PHP, Python or Js/Ts

michaelmior
2 replies
1d2h

Rust executables generally compile to static binaries. No you don't need to install Rust on the server, just compile once locally and copy the binary.

augusto-moura
1 replies
19h9m

That is exactly the problem. Debian prefers the dynamic linking approach, where libraries can be updated individually. The problem usually comes down to having all the cargo dependencies packaged inside the debian repo. Which is doable, a similar thing happens for pip and other tools. But still kinda messy

michaelmior
0 replies
6h26m

I'm confused why that's a problem. Just because Debian prefers dynamic linking doesn't mean it's incapable of running static binaries.

KolenCh
0 replies
18h48m

For most of the rust tools I tried—not this one though—they provided precompiled static binaries that is so easy to deploy to any systems, including ancient distros (like RHEL 7).

So it is easy to solve this problem—just provide pre-compiled binaries on GitHub Releases. I believe the rust ecosystem made this relatively easy.

chaps
8 replies
1d1h

This is more of a `screen` replacement than a `tmux` replacement, yeah? Was hopeful for an actual replacement (no, not iterm) to tmux.

e12e
7 replies
1d1h

Aren't tmux and screen rather equivalent these days? How is an alternative to one, not an alternative to the other?

Shpool doesn't appear to allow for session sharing/remote pairing though?

chaps
6 replies
1d

shpool doesn't allow splitting screens either! But I guess in my head, screen is largely for resuming a shell connection on a remote host while tmux is a window splitter.

Phrodo_00
3 replies
22h37m

Screen and tmux are almost the same these days. Screen used to not allow side-by-side splits, but it can do that too now.

wnoise
2 replies
20h37m

It has allowed that for a long, long time.

chaps
1 replies
9h26m

Okay, but is it actually good?

e12e
0 replies
34m

Screen vertical split works fine.

remram
1 replies
22h55m

Both of them are both of those things.

lanstin
0 replies
1h15m

I always get scared when I accidentally have two shell sessions visible at once in tmux. I immediately exit one. I suppose I should read a bit on it. When I want side to side comparisons I go to the shell running emacs and do it there (post vague because I never remember the different words for windows and panes and shells etc these different apps use.)

beryilma
8 replies
1d3h

How could this be a tmux alternative if it only provides session persistence? I use tmux mostly for layout (tiles, multiple windows, etc.) and not for session persistence necessarily. I don't know if this is why other people also use tmux, but I am not sure if "alternative" is the right word here.

ethanpailes
3 replies
1d

It's definitely not a complete alternative, but a surprising number of tmux users are only in it for the session persistence. We did a little internal (criminally underpowered and confounded) survey of some tmux users at google and found that half of them were only really using it for session persistence. I was really surprised by this and thought more people would be using all the slick tiling features that tmux has.

beryilma
2 replies
22h10m

I think there is a whole group of vim + tmux people out there and their primary use case may not be session persistence, but to construct an IDE like environment, which is also my use case.

leni536
0 replies
16h35m

Note that vim also has windows, tabs and tiling, along with terminals.

ethanpailes
0 replies
18h24m

Yeah I was expecting a lot of that, which is why I found that survey data so surprising.

sullyj3
0 replies
1d2h

It could be a tmux alternative if the session persistence is the only feature of tmux you care about, and you don't like the rest of it.

stvltvs
0 replies
1d3h

I use it the same way because I use it locally 100% of the time. I would probably care about persistence more if I used tmux on remote machines.

barnabee
0 replies
1d3h

I use tmux strictly for persistence only, and WezTerm for layout etc. so this is definitely an alternative for me.

This is very interesting to me as it seems to provide persistence with much less cognitive overhead than tmux or even screen sessions, which are enough that I often don't bother and just use SSH. I also find tmux has a noticable latency overhead (on every terminal I've tried) so I wouldn't use it locally anyway.

Suffice to say this is very interesting and I'll check it out.

andrewla
0 replies
1d3h

There are a bunch of minimalist session persistence solutions, including now shpool. If you want layout, there's a minimalist program called `dvtm` that provides those capabilities.

The suggestion usually is to run dvtm inside of dtach/shpool/abduco/diss for layout, and separating the concerns that way.

blacklion
7 replies
1d4h

No mention of screen? I'm too old.

freedomben
3 replies
1d2h

I betrayed screen over a decade ago and switch to tmux, and have been immensely happy. I have a tremendous amount of love and appreciation for the venerable Screen, but realistically very few people use it anymore. I don't think it makes much sense to compare. For the few that do still use Screen, they pretty much know how it compares to tmux so the tmux compare is pretty applicable.

e12e
2 replies
1d1h

I'm a happy screen user. But tbh, the main benefit (to me) is default ctrl-a key binding, while tmux would require a config (which I actually think is great, that tmux politely doesn't conflict by default).

Not sure why I'd want to switch.

spudlyo
0 replies
23h30m

It doesn't actually require a config. You can set the binding on the command-line when you launch it. Anything you can represent in a config file with Tmux (set -g prefix C-o) can be expressed on the command-line.

Furthermore, in my opinion, both the defaults (C-a, C-b) are bad, as they conflict with default readline key bindings for cursor movement.

freedomben
0 replies
22h52m

Ability to run `tmux <command>` in the terminal and have it affect the current tmux session was a huge feature for me. The other was actually being able to understand and write my config file. You can get somewhat far in Screen without writing any config, but I wanted some small tweaks to optimize my workflow. For example, a more vim-style way to navigate windows, easier splitting of panes, the new prompt on a pane split to be the current working directory of the pane I was on when I triggered the split, easy ability to swap the location of panes, etc. It's not prettified at all since I'm the only (intended) user, but my tmux.conf if it's helpful to anyone: https://gist.github.com/FreedomBen/9c52a6fa1543689798a8a42b6...

jerdfelt
1 replies
1d3h

It is mentioned in the first paragraph of the README:

shpool is a service that enables session persistence by allowing the creation of named shell sessions owned by shpool so that the session is not lost if the connection drops. shpool can be thought of as a lighter weight alternative to tmux or GNU screen.

blacklion
0 replies
1d1h

I mean, nobody mention Screen here, in comments, when I wrote my comment

ethanpailes
0 replies
1d3h

Screen is discussed along with tmux in the [comparison section](https://github.com/shell-pool/shpool#tmux-and-gnu-screen) of the README. For most of the section I just say `tmux` because saying `tmux` or `screen` can get annoying and they have a very similar set of features.

KingOfCoders
7 replies
1d4h

Recently learned about Zellij and it replaced my tmux usage.

aranelsurion
4 replies
1d3h

If you don’t mind explaining, what are the advantages you get over tmux?

xhrpost
3 replies
1d1h

Main thing that's keeping me right now is copy select with mouse that stays in pane. Tmux would always cross horizontal panes so I'd have to zoom the current pane, alt + mouse select, then unzoom. Zellij I just drag over what I want and release the mouse button. I do however miss using the mouse for pane resizing though.

tjoff
2 replies
1d1h

tmux keeps the selection to the pane for me.

Not something I make use of though, feels faster to copy using the keyboard instead.

xhrpost
1 replies
1d

Did you have to use a particular setting? I looked into it a few times but couldn't figure it out.

tjoff
0 replies
23h56m

Tried it in a container with only "set -g mouse on" in the config and it works fine (v. 3.2a).

My best guess is that your terminal selection is overriding tmux.

ibrarmalik
1 replies
1d3h

tmux works out of the box for me.

I tried Zellij and couldn’t get the Alt key to work on mac. And then when ssh’ing into a server I couldn’t see some of the icons because it required a special patched font.

slt2021
5 replies
23h45m

I used to use tmux, but then switched completely jupyter terminals.

my browser is my terminal now, and I can easily upload/download files via browser (dont type SCP anymore) with a mouse click, open terminal windows, open Python notebook and do stuff.

life has never been easier after I completely switched to jupyter notebooks+terminals

plus, because it is browser based, I can roam from multiple devices.

remram
4 replies
23h0m

Doesn't the notebook store outputs locally? Wouldn't it get out of sync when changing device?

Also cells can be out of order and overwritten and such. Seems like a questionable fit.

slt2021
3 replies
21h19m

I use remote notebook and just connect to it.

The key to out of order problem is simple: once a piece of code works - save it in .py module and import it. Very little discipline is required to achieve significant productivity gain.

That way notebook is always clean and tidy and always resembles a “pseudo code”, with implementation detail hidden in modules (that were tested and are working).

remram
2 replies
20h51m

You were talking about replacing the terminal with notebooks, I assumed you meant for terminal tasks.

If you are using notebooks for notebook coding tasks then fine but what does that have to do with tmux?

slt2021
1 replies
20h4m

There are two ways to run shell commands:

1. Jupyter has terminals feature in addition to notebook (New->Terminal instead of New->Notebook). You can run any number of terminal sessions, they will be persisten like tmix and each open in separate browser window.

They are also shareable and easy to collab, so you can toss the terminal URL to your colleague to let him continue where you left off, or let him monitor stdout as you run some long running process.

2. You can run shell command and capture its output in python var inside jupyter cell with “!” macro, for example:

  files = !ls *.csv

This allows you to mix&match and interleave bash and python and store intermediate data in variables, instead of pipes

  files = !ls *.csv
  pd.concat([pd.read_csv(x) for x in files]).MyColname.value_counts().to_frame().to_csv(“summary.csv”)


Just one sample I just used today: This code merge all csv files (and will correctly merge even if column names are random order in diff files), and group by one field and save stats.

This is more readable and maintainable than bash oneliners and magic with awk and more powerful

Things like read cav, json, write parquet, any manipulation with data, both local and remote is a breeze and I dont feel like constrained by bash syntax.

Most importantly code is readable and maintainable

remram
0 replies
3h2m

I see, you're using the JupyterLab Terminal as a terminal, I misread. Apologies.

jauntywundrkind
5 replies
1d4h

There's also the longstanding option dtach, which similarly seems to be a lightweight re-attachable way to run a program. https://github.com/crigler/dtach

For a while I was running neovim on dtach, which let me host all the terminals I might want. It has long felt weird that we have so recursively many layers of management and navigation: the OS juggling multiple terminals, tmux juggling multiple shells, and neovim juggling multiple windows. I was doing pretty good in full screen neovim for a while, but have backed down a bit, still find tmux navigation a bit faster.

zokier
2 replies
1d3h

It has long felt weird that we have so recursively many layers of management and navigation: the OS juggling multiple terminals, tmux juggling multiple shells, and neovim juggling multiple windows

Tbh that's why I'm not a fan of tmux or terminals with fancy internal window management. I suppose it makes sense if your OS level window management is crap (macos...) but otherwise it feels like poor solution

chrisweekly
0 replies
1d

"if your OS level window management is crap (macos...)"

-- in which case Divvy is a great solution. YMMV, but IME, Divvy and iTerm2 cover 98% of the things I'd want to do.

Tyr42
0 replies
1d3h

But tmux on server survives the laptop sleeping. That's the key value.

andrewla
0 replies
1d4h

dtach, abduco, and diss are all mentioned in comparison at the bottom of the page. I've never used diss before, but the other two are good products, but for some reason the ergonomics never quite seem to work out for me and I revert back to tmux.

Similarly dvtm, which is a minimalist version of the window management aspects of tmux but omits the session management, also never quite seems to click for me.

Retr0id
0 replies
1d4h

The readme contains a brief comparison to dtach: https://github.com/shell-pool/shpool?tab=readme-ov-file#dtac...

IIUC, the main difference is that shpool maintains an in-memory copy of terminal state that it can use to re-draw after a reconnect, so you don't lose all your scrollback.

radarsat1
3 replies
1d

Looks nice. One feature I'd like is a read-only mode. Sometimes I want to execute a long running process and be able to just watch it run without risking that I hit Ctrl C by accident. I was surprised to find that Screen doesn't support this, I guess probably tmux does. tail is fine but I don't always want to record a huge log file.

mctt
2 replies
22h30m

| /dev/null ?

radarsat1
0 replies
12h6m

How would you tail /dev/null?

KolenCh
0 replies
18h45m

I guess they mean they want to be able to look at latest stdout/err without having to write it to a file, but not discarding it all

pnutjam
3 replies
1d3h

Why is this better then the old school "screen"?

OwseiWT
1 replies
1d2h

I'd say the best part is not needing screen on the server. If you have several servers and several people that like several multiplexers, you would need to install all of them in each server, and manage configuration etc.

However, you can have your own multiplexer and use shpool on a window to connect to a server. Done, you have your favorite multiplexer, with your configuration, and the only tool in the server is shpool

michaelmior
0 replies
1d2h

I'm not following what the difference is between installing screen on the server and installing shpool in the server.

pnutjam
0 replies
1d3h

answer to my question is on the description page of Shpool. Looks compelling. ---- The biggest advantage of this approach is that shpool does not break native scrollback or copy-paste.

gregwebs
3 replies
1d4h

Unbundling tmux is a great concept!

Other tools that can overlap in use case are EternalTerminal and mosh which provide sessions that survive disconnects.

remram
0 replies
22h58m

I am currently using mosh and tmux together, it does seem like there's a lot duplication. It works great though, and mosh has actual roaming which is good for subways, VPN changes, etc.

ethanpailes
0 replies
1d3h

Oh thanks for mentioning EternalTerminal. I should add it to the comparison section in the README. It looks like it is similar to mosh in that it does stuff at the network level whereas all these other tools are purely remote-machine side programs, but it seems like it is a bit simpler than mosh. From a scan of their docs it sounds like they have the local terminal do all the rendering the way `shpool` does and don't try to muck about with any sort of predictive rendering the way mosh does. Does that sound right to anyone knows it well?

dbtc
0 replies
16m

For me, mosh and tmux are like socks and shoes.

1vuio0pswjnm7
2 replies
18h32m

"The main way that shpool differs from tmux is that tmux is a terminal multiplexer which necessarily means that it offers session persistence features, while shpool only aims to be a session persistence tool. In contrast to tmux the philosophy of shpool is that managing different terminals is the job of your display or window manager, not your session persistence tool."

What if the computer user does not use a window manager. Many years ago I stopped using X11 and started using textmode only. Then tmux was released and appeared in NetBSD packages collection, it soon went into NetBSD base and I have been using it with almost zero problems ever since. If I am forced to run a graphics layer so that I can run a window manager so that I can run shpool, then is this solution truly "lightweight". The shpool program might be lightweight but the system I would need to run it would be heavyweight, when compared with textmode, no graphics.

For me, an assessment of "lightweight" also needs to consider the compile-time requirements. For example, I use a static copy of GCC that weighs in at 242.3 MiB and I can obtain libevent and libtinfo, the only two third-party tmux dependencies, from any number of mirrors across the internet. I like that GCC does not try to connect to the internet by default, or otherwise. When I lose an internet connection, I use the time to compile programs. GCC, and probably most if not all C compilers, add no friction to doing that.

lmz
0 replies
15h40m

Then you can run tmux locally for the multiple windows and then in each window use this if you need to connect remotely to resumable sessions there.

On the other hand if your use case is just windowing on a single host (local only or remote only) then probably stick with tmux.

1vuio0pswjnm7
0 replies
13h46m

"Scrollback and copy-paste will work exactly as they do in your native terminal, while they can behave differently when using tmux."

I use tmux for session management, including but not limited to windowing, on each single host. I generally work _outside_ tmux, using send-keys to interact with each window. I have daemons running in their own windows.

There is no graphics layer, no window manager and no terminal emulator. I stay in textmode.

I make heavy use of tmux features like send-keys and buffers. I use buffers, namely load-buffer, paste-buffer and save-buffer, as "copy-paste".

I do not use a mouse. I "select text" using UNIX utilities, not cursor movement.

The tmux scrollback buffer is not an issue because I work outside of tmux. For daemons running in tmux windows, I use multilog and tai64nlocal for logging.

The copy-paste issue is a non-issue because the "native terminal" for me is textmode and textmode, unlike a terminal emulator, has no copy-paste.

This tmux setup is lighter weight than running 1. a graphics layer, 2. a window manager, 3. a terminal emulator and 4. shpool.

themk
1 replies
16h12m

This seems to suffer the same problem as abduco, which is, you better be reconnecting from the same terminal (don't change your termcap). Fine if working from a single machine.

I did notice they have a vt100 emulator, but it's only used for screen restore?

It seems the focus of the tool is for reconnecting from the same machine.

ethanpailes
0 replies
6h20m

Yeah reconnecting from different terminals is a pretty tricky problem to solve (and in fact can't be solved in general because of potential skew between the terminfo db on the client machine and the remote machine). The big problem is that once you launch a shell, there is no great way to change environment variables from outside that shell, so you can't change the value of TERM for a running shell. I have thought about trying some LD_PRELOAD tricks to try to be able to call setenv() from within the shell process itself, but this always struck me as something that would require a pretty big hack.

tambourine_man
1 replies
20h6m

This looks awesome, what a great simple idea. I like tmux, but native smooth scrolling is so much better. So is searching, copy and pasting.

Is it tested on macOS? Ready for use in production?

Thanks

ethanpailes
0 replies
19h13m

You can definitely use it in production, it is deployed internally at Google and we have a bunch of users. It doesn’t currently work on MacOS, but one of my colleagues is currently working on a port to Mac.

rabite
1 replies
22h16m

This is absolutely awesome. For ages I have needed an alternative to mosh that did not require UDP -- I run every outbound connection over Tor, so I only have TCP transport available. This is an incredible improvement to my quality of life.

amethyst
0 replies
22h12m

You might prefer Eternal Terminal as a TCP mosh alternative:

https://eternalterminal.dev/

pipeline_peak
1 replies
12h21m

We live in a GUI world and you’re on a terminal, how much space does Tmux take up exactly?

johnisgood
0 replies
19m

80x24

jamal-kumar
1 replies
1d

Years ago I had a boss who gave me a hard time for how much resources tmux was using on linux and said that it performed fine where it's developed natively (openbsd) but something in it was making it eat resources compared to screen on constrained linux systems. I wonder if this is still the case?

DEADMINCE
0 replies
21h30m

If he was an OpenBSD fan he might have been overly anti-Linux.

freddieventura
1 replies
20h46m

For me tmux is everything. But I have been looking for 2 utilities they may not exist.

- tty keystroke router: A program that lets you send keystrokes to different tty's (ideally tmux sessions) but not taking over the actual terminal (so sort of a background application , a daemon that listen to a certain key bind and upon pressing it will route all the keypresses to a certain tty/tmux session.

- tty screen real estate extender: Basically be able to link one tty (tmux-window) (attach to it) from two different terminals. These two terminals one of them will be displaying the first N columns second terminal attached will be displaying from N till width of the tty (so you can hook up two monitors and widden your ttys)

_kst_
0 replies
17h3m

For the second, <git://git.subdivi.de/~helmut/tcvt.git> might be useful. It's not quite what you asked for; it emulates a two-column virtual terminal within another (virtual) terminal.

If you can extend your terminal window across your two monitors and run `tcvt` within it, that might suit your purposes.

feel-ix-343
1 replies
20h36m

Will this one not try to be a window manager?

ethanpailes
0 replies
18h26m

Not trying to be a window manager is pretty much the reason it exists!

cryptonector
1 replies
15h10m

The biggest advantage of this approach is that `shpool` does not break native scrollback or copy-paste.

tmux/screen do not break copy-paste. And that tmux/screen have their own scrollback is a feature.

The selling point for shpool is simplicity, which I appreciate. I need terminal multiplexing, but I might use shpool here and there.

jiripospisil
0 replies
3h10m

tmux/screen do not break copy-paste

Tmux breaks interacting with the clipboard so much that it has its own dedicated Wiki page dealing with all of the different issues and settings: https://github.com/tmux/tmux/wiki/Clipboard

VagabundoP
1 replies
1d2h

I always found tmux and screen clunky to use when all I wanted was the persistence so this project is right up my alley.

cryptonector
0 replies
15h7m

tmux/screen is a way of life.

zft
0 replies
9h36m

screen is lightwight tmux alternative

tasuki
0 replies
1d2h

Oh, this might be the missing piece of the puzzle for me to get rid of tmux!

I've been using screen/tmux for a long time. Recently I switched to kitty[0] locally. I like kitty a lot! But I've been stuck with tmux on my servers for session persistence.

[0]: https://sw.kovidgoyal.net/kitty/

santiagobasulto
0 replies
11h53m

I love tmux. I don't think this is a replacement for it. At most, for `screen`. I use tmux locally for my day to day work. I have different named sessions for different things I'm doing (switching back and forth) and I have multiple windows and panes. The best thing is that I can switch terminal emulators without having to learn any new keyboard shortcuts.

praveen4463
0 replies
1d2h

Will use it for sure. starred it.

nazgu1
0 replies
22h51m

I like it. Recently, I realized that I’m looking for tools that are doing one thing well. It looks like such tool and I will give it a try

animegirl2024
0 replies
11h54m

The project is awesome. I like the terminal session tool that can help to improve my job. Thank you for your sharing.

Scarbutt
0 replies
1d2h

Besides persistence, terminal multiplexing is one of the greats things of tmux. If I'm programming on a remote machine I don't want to open a new ssh connection from each of the five terminals that I need. Seems tedious when I can just create a new window inside tmux. Even locally, I don't want to have 10 terminals opened (or tabs), tmux lets you have multiple terminal windows/panes from a single physical terminal and lets you easily group and switch between them into what they call sessions.

149765
0 replies
4h1m

Not sure, if it's a bug, but it eats 1.4G memory after running find for a few seconds, detaching, re-attaching and running find again.

        Active: active (running) since Fri 2024-06-14 19:26:55 +05; 27s ago
    Invocation: d84b9281e0f64a798c4e555836815036
    TriggeredBy: ● shpool.socket
    Main PID: 3895609 (shpool)
        Tasks: 15 (limit: 154377)
        Memory: 1.4G (peak: 1.4G)
            CPU: 6.566s
        CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/shpool.service
                ├─3895609 /usr/local/bin/shpool daemon
                ├─3895629 -fish
                ├─3895719 systemctl --user status shpool
                └─3895720 pager