Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat(shell): update Ghostty tab title to project name on cd

Adam Eivy70bd8a883f6b
diff --git a/.changelog/v0.14.x.md b/.changelog/v0.14.x.md
index a1ae84c53b..08a09ad16c 100644
--- a/.changelog/v0.14.x.md
+++ b/.changelog/v0.14.x.md
@@ -11,7 +11,7 @@ This release adds Ghostty terminal theme integration and a project update workfl
### Ghostty Shell Integration
- **6 custom terminal themes** (blue, green, purple, orange, red, cyan) — each theme has a distinct color palette tuned for different project types
- **`proj` launcher function** — open any project directory in a themed Ghostty window with `proj <path> [theme]`; auto-detects `.ghostty-theme` files for per-project theming
-- **Auto-theme on `cd`** — OSC escape sequences dynamically recolor the terminal when entering/leaving directories with `.ghostty-theme` files (chpwd hook)
+- **Auto-theme on `cd`** — OSC escape sequences dynamically recolor the terminal and update the tab title when entering/leaving directories with `.ghostty-theme` files (chpwd hook)
- **`proj-themes` listing** — shows all available themes with emoji indicators and descriptions
- **`setup-ghostty.js` installer** — copies themes to Ghostty config dirs, adds shell source line to `~/.zshrc` (all idempotent)
- **Opt-in during `setup.sh`** — first-time setup prompts for Ghostty integration; safe to skip if Ghostty isn't installed
diff --git a/shell/ghostty.sh b/shell/ghostty.sh
index d4b53d0ae4..159224ecd6 100755
--- a/shell/ghostty.sh
+++ b/shell/ghostty.sh
@@ -175,10 +175,18 @@ function _ghostty_apply_osc() {
if [[ -n "$theme_file" ]]; then
GHOSTTY_THEME_ACTIVE="$theme_file"
_ghostty_set_colors "$theme_file"
+ # Set tab title to project name with theme emoji
+ local project_dir="$(dirname "$theme_file")"
+ local project_name="$(basename "$project_dir")"
+ local theme_name="$(_ghostty_theme_name "$theme_file")"
+ local emoji="$(_ghostty_theme_emoji "$theme_name")"
+ printf '\e]2;%s\a' "${emoji} ${project_name}"
elif [[ -n "$GHOSTTY_THEME_ACTIVE" ]]; then
# Left a themed directory — reset to defaults
GHOSTTY_THEME_ACTIVE=""
_ghostty_reset_colors
+ # Reset title (empty string restores default behavior)
+ printf '\e]2;%s\a' ""
fi
}