Show HN: Shpool - The Lightweight Alternative to Tmux

BY Mark Howell 13 June 20244 MINS READ
article cover

Shpool is a lightweight alternative to popular terminal multiplexers like tmux and GNU screen. It focuses solely on providing session persistence without taking over the entire terminal or disrupting native scrollback or copy-paste functionalities.

Key Features and Installation

Shpool enables the creation of named shell sessions owned by the service itself. This ensures resilience against connection drops, allowing sessions to persist uninterrupted. It stands out by maintaining the native terminal experience—something both tmux and GNU screen cannot fully achieve.
Installation is straightforward via crates.io. Typically, users will need to install shpool on the remote host they wish to connect to.

Usage

Once installed and set up, using shpool is relatively simple. You would typically SSH into your remote host and create a new named session using:
shpool attach {session_name}
Where `{session_name}` would be a unique identifier for each terminal session. For example:
shpool attach main
If your session gets disconnected, you can simply reconnect to the same session by running:
shpool attach main
To forcefully detach a session in case it gets stuck due to SSH proxies holding the connection, you can use:
shpool detach main

Configuration

Shpool offers extensive configuration options to customize your experience. A key example is the ability to change the detach keybinding, which by default is `Ctrl-Space Ctrl-q`. This and other options can be set in `~/.config/shpool/config.toml`.
There are also multiple modes for reattaching to a session:

  • Screen Mode: Re-draws enough output to fill the entire screen, useful for interactive sessions.

  • Simple Mode: Issues SIGWINCH signals to ncurses applications to re-draw the screen without restoring any output.

  • Lines Mode: Restores the last `n` lines of text, which is configurable in the `output_spool_lines` option.
    For Bash users, setting the `huponexit` option ensures that background processes do not remain in the shpool daemon's process tree.

Subcommands

Shpool comes with various subcommands:

  • daemon: Runs in daemon mode to handle connections and open subshells.

  • attach: Connects to an existing session or creates a new one.

  • detach: Detaches from one or more sessions without stopping them.

  • list: Lists all current shell sessions.

  • kill: Kills a named shell session.
    Automatically Connecting to Shpool
    For users who frequently connect to multiple sessions performing similar tasks, custom SSH configurations or shell functions can simplify the process.
    For example, creating a named block in `~/.ssh/config`:
    Host edit
    HostName remote.host.example.com
    User yourusername
    LocalCommand shpool attach edit
    And invoking it via `ssh edit`.
    Alternatively, a shell function approach allows you to specify both the session name and the target machine at invocation time.

Comparison with Other Tools

Shpool differentiates itself from tmux by purely focusing on session persistence without additional multiplexing features. This makes it ideal for users who leverage their window manager for switching applications.
It also maintains a native terminal feel, which is a significant advantage over tmux and GNU screen. Scrollback and copy-paste work exactly as expected since all rendering is handled by the single terminal state machine.
In comparison to mosh, which predicts output during network lag and impacts scrollback, shpool keeps functionalities completely native to your terminal.
Dtach, abduco, and diss are close competitors but with a heavier focus on simplicity. Shpool offers additional convenient features like automatic prompt prefixes and in-memory re-attaching without sacrificing ease of use.

Conclusion

Edworking is an optimal choice for startups aiming to boost productivity. This free superapp powered by AI integrates all essential tools for work including task management, documents, chat, video calls, and file management. Discover why it's considered the best solution for small businesses and startups to enhance their workflow and save expenses usually spent on multiple other software such as Slack, Trello, Dropbox, Zoom, and Notion by exploring Edworking's product management for teams features.
For more information on alternative terminal multiplexer tools, visit this comprehensive comparison.

Remember these 3 key ideas for your startup:

  1. Session Persistence Without Frills: Shpool provides robust session persistence without overwhelming features like multiplexing, making it perfect for startups looking to maintain a minimalist yet effective toolset for remote work.

  2. Native Terminal Experience: By preserving the native terminal experience, shpool ensures that your workflow remains smooth and intuitive, crucial for maintaining productivity in a startup environment.

Customizability and Flexibility: Shpool's extensive configuration options and easy-to-create custom SSH or shell functions empower startups to tailor their remote session management to fit unique workflows and requirements.

  1. Image Description: Example of shpool setup showing a persistent session managed through shpool in a terminal.
    For more details, see the original source.

article cover
About the Author: Mark Howell Linkedin

Mark Howell is a talented content writer for Edworking's blog, consistently producing high-quality articles on a daily basis. As a Sales Representative, he brings a unique perspective to his writing, providing valuable insights and actionable advice for readers in the education industry. With a keen eye for detail and a passion for sharing knowledge, Mark is an indispensable member of the Edworking team. His expertise in task management ensures that he is always on top of his assignments and meets strict deadlines. Furthermore, Mark's skills in project management enable him to collaborate effectively with colleagues, contributing to the team's overall success and growth. As a reliable and diligent professional, Mark Howell continues to elevate Edworking's blog and brand with his well-researched and engaging content.

Trendy NewsSee All Articles
CoverDecoding R1: The Future of AI Reasoning ModelsR1 is an affordable, open-source AI model emphasizing reasoning, enabling innovation and efficiency, while influencing AI advancements and geopolitical dynamics.
BY Mark Howell 26 January 2025
CoverSteam Brick: A Minimalist Gaming Console Redefines PortabilitySteam Brick: A modified, screenless Steam Deck for travel, focusing on portability by using external displays and inputs. A creative yet impractical DIY project with potential risks.
BY Mark Howell 26 January 2025
CoverVisual Prompt Injections: Essential Guide for StartupsThe Beginner's Guide to Visual Prompt Injections explores vulnerabilities in AI models like GPT-4V, highlighting security risks for startups and offering strategies to mitigate potential data compromises.
BY Mark Howell 13 November 2024
CoverGraph-Based AI: Pioneering Future Innovation PathwaysGraph-based AI, developed by MIT's Markus J. Buehler, bridges unrelated fields, revealing shared complexity patterns, accelerating innovation by uncovering novel ideas and designs, fostering unprecedented growth opportunities.
BY Mark Howell 13 November 2024
CoverRevolutionary Image Protection: Watermark Anything with Localized MessagesWatermark Anything enables embedding multiple localized watermarks in images, balancing imperceptibility and robustness. It uses Python, PyTorch, and CUDA, with COCO dataset, under CC-BY-NC license.
BY Mark Howell 13 November 2024
CoverJungle Music's Role in Shaping 90s Video Game SoundtracksJungle music in the 90s revolutionized video game soundtracks, enhancing fast-paced gameplay on PlayStation and Nintendo 64, and fostering a cultural revolution through its energetic beats and immersive experiences.
BY Mark Howell 13 November 2024
CoverMastering Probability-Generating Functions: A Guide for EntrepreneursProbability-generating functions (pgfs) are mathematical tools used in probability theory for data analysis, risk management, and predictive modeling, crucial for startups and SMEs in strategic decision-making.
BY Mark Howell 31 October 2024
CoverMastering Tokenization: Key to Successful AI ApplicationsTokenization is crucial in NLP for AI apps, influencing data processing. Understanding tokenizers enhances AI performance, ensuring meaningful interactions and minimizing Garbage In, Garbage Out issues.
BY Mark Howell 23 October 2024
Try EdworkingA new way to work from  anywhere, for everyone for Free!
Sign up Now