Skip to content
IamShreshthPublic

About

WingMan ;) for your Terminal -> tman

Topics

Resources

Contributing

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

tman

A persistent terminal session manager with an interactive navigation HUD.

Rust License: MIT Platform Shell Dependencies Repository views


tman interface preview

tman launches a persistent shell session side-by-side with an interactive navigation HUD in a single terminal window.
The shell tab is a real, fully-featured zsh process — you can run vim, htop, fzf, less, or any other program in it, and tman stays out of the way. Press the toggle key (Shift+S by default) to flip focus between the shell and the HUD without leaving the terminal.

Legacy --overlay mode — if you just want the old-style ephemeral popup overlay that exits and runs a command, pass --overlay:
tman --overlay
This is kept for scripts and keybindings that depended on the original behaviour.


Quick Start

1. Install

curl -fsSL https://raw.githubusercontent.com/IamShreshth/Tman/main/files/install.sh | bash

2. Activate

source ~/.zshrc

3. Launch

tman        # persistent session (default)
tman --overlay   # legacy ephemeral overlay

macOS Installation (Apple Silicon & Intel)

Option 1: Single-Step Installer (Recommended)

Automatically detects Apple Silicon (arm64) or Intel (x86_64), installs tman, signs the binary (codesign) so Gatekeeper never prompts, and configures ~/.zshrc:

curl -fsSL https://raw.githubusercontent.com/IamShreshth/Tman/main/files/install.sh | bash
source ~/.zshrc

Option 2: Homebrew + Cargo (Build from Source)

# 1. Ensure Xcode Command Line Tools & Rust are installed
xcode-select --install 2>/dev/null || true
brew install rust   # OR: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# 2. Install tman via Cargo
cargo install --git https://github.com/IamShreshth/Tman.git --locked

# 3. Activate in zsh (zsh is the default shell on macOS):
echo 'eval "$(tman init zsh)"' >> ~/.zshrc && source ~/.zshrc

macOS notes:

  • pbcopy (clipboard) and open (Finder / default app opener) work out of the box — no extra packages needed.
  • Terminal.app users: go to Preferences → Profiles → Keyboard and enable "Use Option as Meta key" so that Alt-based shortcuts reach tman correctly.
  • Ctrl+Space sends a null byte on some macOS terminals. If you want to use ctrl+space as the toggle key, configure an alternative in ~/.config/tman/config.toml (e.g. toggle_key = "shift+s" or toggle_key = "alt+space").

Linux Support

Note: Linux support is coming in a later release. The --overlay mode works on Linux today; the full persistent session (tman ui) is currently macOS-only (requires zsh + macOS PTY APIs). Watch the linux branch for progress.

For now on Linux, use the overlay mode:

tman --overlay

How It Works

┌──────────────────────────────────────────────────┐
│  tman · NAV    ~/projects/myapp   ⎇ main +2 ~1  │  ← header
├──────────────────────────────────────────────────│
│  1 zsh                                           │  ← tab bar
├─────────────────────────┬────────────────────────│
│                         │  HUD · FOCUS           │
│   real zsh shell        │  ▸ Navigate            │
│   (vim, htop, fzf…)     │  * Bookmarks           │
│                         │  ↺ History             │
│                         │  ⌕ Search              │
│                         │  ⎇ Git                 │
│                         │  ▶ Run                 │
├─────────────────────────┴────────────────────────│
│  S Switch  h HUD  v Copy  Ctrl+T New tab  …      │  ← footer
└──────────────────────────────────────────────────┘
  • Left pane — a real embedded zsh process via PTY. Full alt-screen, mouse, truecolor support.
  • Right pane (HUD) — the interactive nav/action panel.
  • Press the toggle key (Shift+S) to move keyboard focus between panes.
  • Press h to hide/show the HUD and give the shell the full width.

Keyboard Controls

Global (always active)

Key Action
Shift+S (default toggle key) Switch keyboard focus between Shell and HUD
h Hide / show the HUD panel
Ctrl+T Open a new shell tab
Ctrl+W Close the current shell tab
Ctrl+← / Ctrl+→ Switch between shell tabs (NAV focus only)

Shell focus (SHELL mode)

Key Action
All keys Forwarded verbatim to the embedded zsh process
PageUp / PageDown Scroll the shell's scrollback buffer (at prompt only)

HUD focus (NAV mode)

Key Context Action
↑ / ↓ or j / k Navigation Move cursor
Enter Any view Execute selected action / cd into folder
→ File browser Open highlighted directory
← / Backspace Submenus Go to parent directory / previous view
b Menu / Files Bookmark current or highlighted directory
d or x Bookmarks Delete highlighted bookmark
Space Git changed files Stage / unstage file
Q File browser cd shell into browsed directory
Tab Browser / Runners Open file action menu
/ Lists Fuzzy-search filter
. File browser Toggle hidden dotfiles
m Submenus Return to main menu
C Any (NAV) cd shell to the HUD's current directory
v Any (NAV) Enter copy mode (select & yank lines from shell)
Esc Any view Clear search / close modal / exit
Ctrl+C / Ctrl+D Any view Quit tman

Copy mode (COPY mode)

Key Action
↑ / ↓ Move cursor line
v Set anchor (start of selection)
y Copy selected lines to pbcopy (macOS clipboard)
PageUp / PageDown Scroll the shell's scrollback buffer
Esc / q Exit copy mode

macOS Ctrl+Space note: Some terminal emulators on macOS (especially Terminal.app) intercept Ctrl+Space before it reaches tman. Use Shift+S (the default) or configure toggle_key = "alt+space" in ~/.config/tman/config.toml.

Terminal.app Option/Alt note: In Preferences → Profiles → Keyboard, enable "Use Option as Meta key" to send Alt+… sequences that tman and embedded CLI tools expect.


--overlay Mode

The --overlay flag runs tman in the original single-panel overlay style — it takes over the terminal, you pick an action, and tman exits cleanly returning the command to your shell to execute:

tman --overlay

This mode works on any POSIX shell (bash, fish, zsh) and any OS where the binary runs. Use it for:

  • Shell keybindings that need a quick popup (e.g. bind tman to a hotkey in your shell config)
  • Environments where the persistent session isn't available yet (Linux)
  • Scripts that need a one-shot action picker

Configuration

Config file location: ~/.config/tman/config.toml
Print the path: tman config-path
Print defaults: tman default-config

bookmarks = []

[ui]
animations = true       # slide-in context panel
preview = true          # preview pane inside HUD
show_hidden = false
accent = "cyan"         # cyan|blue|green|magenta|yellow|red|orange|purple|pink|peach|teal|white|#hex

[shell]
editor = ""             # empty = $VISUAL / $EDITOR / vi
toggle_key = "shift+s"  # switch between shell and HUD focus
                        # examples: "shift+s" | "alt+space" | "ctrl+backslash" | "f1"

[safety]
confirm_destructive = true

Capabilities

  • Persistent shell session: a real zsh process runs inside tman; your history, aliases, and functions are all there.
  • Full alt-screen support: vim, htop, fzf, less, and any TUI app works correctly in the shell pane.
  • Truecolor & 256-colour fallback: tman detects COLORTERM=truecolor and forwards it to the embedded shell; falls back to xterm-256 palette automatically.
  • Unicode width-aware rendering: wide CJK characters, emoji, and combining marks display correctly.
  • System telemetry: battery, CPU load, memory, disk, and Git status in the HUD context panel.
  • Workflow discovery: auto-detects Rust, Python, Node, Go, Docker, Make, CMake, Just projects and surfaces their runnable targets.
  • Navigation & actions: fuzzy directory search, bookmark pinning, clipboard export (pbcopy on macOS), and desktop app opening (open on macOS).
  • Robustness: panic hook + drop guard restore the terminal on every exit path; dead PTY is detected and reported cleanly.

Requirements

Component Requirement
Operating System macOS (Apple Silicon arm64 & Intel x86_64)
Shell zsh v5.0+
Terminal emulator Any that supports xterm-256color; truecolor optional
Build Toolchain Rust 1.70+ and Cargo (only when building from source)

Linux support (full persistent session) is planned. See the linux branch and linux.md.


Shell Integration

The shell hook wires up:

  • Automatic CWD tracking (HUD follows cd commands instantly)
  • Prompt-ready detection (so command dispatch waits for the shell)
  • Command-finished notification (HUD refreshes git/file state after each command)
# Add to ~/.zshrc:
eval "$(tman init zsh)"

Installation

Single-step (recommended)

curl -fsSL https://raw.githubusercontent.com/IamShreshth/Tman/main/files/install.sh | bash
source ~/.zshrc

Cargo

cargo install --git https://github.com/IamShreshth/Tman.git --locked
echo 'eval "$(tman init zsh)"' >> ~/.zshrc && source ~/.zshrc

Build from source

git clone https://github.com/IamShreshth/Tman.git
cd Tman
./files/install.sh

Uninstallation

rm -f ~/.local/bin/tman ~/.cargo/bin/tman
rm -rf ~/.config/tman

Remove the eval "$(tman init zsh)" line from your ~/.zshrc.


Contributing

See CONTRIBUTING.md for development setup and pull request guidelines.


License

Licensed under the MIT License.

About

WingMan ;) for your Terminal -> tman

Topics

Resources

Contributing

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages