Skip to content

BobStrogg/sesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sesh

Named persistent shell sessions — zero config, single binary.

sesh lets you create, detach from, and reattach to shell sessions, similar to tmux or screen, but with a simpler interface and no configuration. It's a single static binary with no dependencies.

Install

curl -fsSL "https://github.com/BobStrogg/sesh/releases/latest/download/sesh-$(uname -s | tr A-Z a-z)-$(uname -m | sed 's/arm64/aarch64/')" -o ~/.local/bin/sesh && chmod +x ~/.local/bin/sesh

Or via npm:

npm install -g @bobstrogg/sesh

Or build from source:

cargo install --path .

Quick start

sesh dev .              # Create a session named "dev" in the current directory
                        # Press Ctrl-\ to detach
sesh dev                # Reattach (searches local, then remotes)
sesh                    # List all sessions
sesh --kill dev         # Kill a session

Features

  • Named sessions — create and attach by name
  • Persistent — sessions survive disconnects; reattach anytime
  • Smart lookupsesh <name> finds sessions across local and remote hosts
  • Scrollback replay — see recent terminal history when reattaching
  • Tab completion — auto-configured for bash and zsh
  • Remote support — manage sessions on remote hosts over SSH
  • Cross-platform deploysesh --deploy @host installs the correct binary
  • Export/import — back up and recreate your session layout
  • No screen clearing — does not interfere with terminal state

Usage

sesh                          List all sessions (local + remotes)
sesh <name> [dir]             Create or attach to a session
sesh --kill <name>            Kill a session (local or remote)

sesh @<host>                  List sessions on a remote host
sesh @<host> <name> [dir]     Create or attach to a remote session
sesh @<host> --kill <name>    Kill a remote session

sesh --deploy @<host>         Deploy sesh to a remote host
sesh --upgrade                Redeploy sesh to all known remotes
sesh --export                 Export session layout
sesh --import [file]          Recreate sessions from an export
sesh --completions <shell>    Print shell completions (bash, zsh)
sesh --help                   Show help (-h)
sesh --version                Print version (-V)

Detach from a session with Ctrl-\.

Smart session lookup

When you run sesh <name> without specifying a host:

  1. Local first — attaches if a local session matches
  2. Remote search — queries all known remotes in parallel
  3. Auto-connect — connects if found on exactly one remote
  4. Prompt — asks you to choose if found on multiple remotes

sesh --kill uses the same smart lookup.

Remote sessions

sesh @myserver dev ~/project    # Create a session on a remote host
sesh --deploy @myserver         # Deploy sesh to a remote host
sesh --upgrade                  # Redeploy to all known remotes

Deploy detects the remote OS/arch and installs via npm. Falls back to copying the local binary if platforms match.

How it works

sesh is a single Rust binary that manages PTY-backed shell sessions via Unix sockets. Each session is a background daemon process that owns a PTY and listens on ~/.sesh/<name>.sock. The daemon maintains a scrollback buffer so reattaching shows recent terminal history. The client handles SSH disconnections gracefully — sessions survive any network interruption.

Supported platforms

OS Architecture
Linux x86_64
Linux aarch64
macOS Apple Silicon (M1+)
macOS Intel

Linux binaries are statically linked (musl) and work on any distro.

License

MIT

About

Named persistent shell sessions. Single static binary, no dependencies.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors