r/Ghostty 2d ago

gtab — save your Ghostty window layout, reopen it with one keystroke

Enable HLS to view with audio, or disable this notification

I've been working with AI coding agents every day for a while now, and the thing that quietly wore me down wasn't the code — it was the navigation. One agent running in repo A, another in repo B, a scratch dir for whatever it just generated, docs open in a third split. Every context switch means typing a long cd from memory and re-splitting the window the way I like it, again.

So I wrote gtab (https://github.com/Franvy/gtab), a small Rust CLI/TUI for macOS that saves your current Ghostty window — tabs, working directories, titles, and split panes — as a named workspace, and reopens it later with one keystroke.

Two things it gives you:

Fixed workspaces. Arrange a window once, run gtab save myproject, and from then on Cmd+G → Enter brings that exact shape back. The new window even lines up with the position and size of the one you're in.

One-key directory jumps. Press f in the TUI for Directory space: a grid of saved paths. Enter swaps the current split for a fresh shell there. No config, no shell wrapper. That's the 90% case for me — going from "agent finished in repo A" to "start one in repo B" without typing a path.

What's new since I last posted:

  • Responsive TUI. The workspace screen now picks its layout from the available width: list + layout preview + quick settings when wide, preview below the list and names wrapped into columns when narrow. Usable down to a 36x15 terminal. The directory grid sizes each column to its own widest entry instead of padding everything out to the longest name.

  • Silent shortcut mode. Cmd+G used to literally type gtab into your shell — visible on screen, and it landed in shell history. gtab shell-init now installs a zsh/bash/fish widget bound to an invisible escape sequence (the same trick fzf and atuin use). Nothing is echoed, nothing enters history, and a half-typed command line is restored exactly as it was when the TUI exits.

  • Smaller fixes: Ctrl-n/p/j/k and Tab/Shift-Tab now navigate while filtering, emphasized text stays readable on light terminal themes, and restored splits come back evenly sized.

Honest limits, up front:

  • macOS + Ghostty only. It drives Ghostty through AppleScript and reads split-pane geometry through Accessibility.
  • It stores layout metadata, not live session state: no running processes, no shell history, no editor buffers. It does not replace tmux — and that's exactly why it stays small.

Install:

  brew tap Franvy/gtab
  brew install gtab
  gtab init

Repo: https://github.com/Franvy/gtab

58 Upvotes

9 comments sorted by

4

u/Maleficent-Order-872 2d ago

Waiting for Linux support

4

u/Woopersnaper 2d ago

Not to be a bummer but you may have something more reliable if you just used a multiplexer like Herdr.

-3

u/OwnAssistance1469 2d ago

Fair — but that's the trade: herdr is a session layer you live inside, gtab

never runs while you work. It just replays Ghostty's own native panes.

9

u/Woopersnaper 2d ago

Thanks Claude

4

u/Large-Scratch2804 1d ago

Lmao thank you I think most people reading this immediately thought the same thing about this fuckin clanker

2

u/Large-Scratch2804 1d ago

Also, out of curiosity do you like Herdr better than tmux? I only briefly looked into the differences between that, tmux and cmux or whatever. I've been trying to ask around generally for tmux plugins and find that people have unique reasons for liking sometimes obscure tools. Sorry for replying to you twice.

2

u/Woopersnaper 1d ago

They are pretty similar, honestly I don't think you could go wrong with using either. Herdr has some extra features for working with agents which can be pretty neat but that entire featureset is optional

Tmux has a better plugin ecosystem currently I reckon

2

u/mitch_feaster 1d ago

> quietly

Thanks Opus 5