Skip to content

Mirror Ghostty-style terminal titles#1

Open
ben-million wants to merge 1 commit into
mainfrom
feat/ghostty-style-titles
Open

Mirror Ghostty-style terminal titles#1
ben-million wants to merge 1 commit into
mainfrom
feat/ghostty-style-titles

Conversation

@ben-million
Copy link
Copy Markdown

@ben-million ben-million commented May 3, 2026

Summary

  • Add foreground process detection so active commands update the terminal/page title.
  • Fall back to Ghostty-style cwd titles when the shell is idle, including home abbreviation and deep-path truncation.
  • Cover process selection and cwd title formatting with focused server tests.

Test plan

  • pnpm --filter localterm-server test -- foreground-process-title working-directory-title
  • pnpm build
  • Manual smoke test: idle cwd title -> running command title -> cwd title after command/cd

Made with Cursor


Note

Medium Risk
Adds periodic ps-based process inspection and cwd resolution to drive session titles, which can impact performance/portability and introduces timer lifecycle/concurrency concerns in the session runtime.

Overview
Updates session title behavior to automatically reflect what’s running: sessions now poll for the PTY’s foreground process and set the title to that command name when available.

When no foreground job is detected, the title falls back to a Ghostty-style working-directory display (home abbreviation and deep-path truncation). This introduces new process/title utilities (foreground-process-title.ts, working-directory-title.ts), new tuning constants, and focused Vitest coverage for process selection and cwd-title formatting.

Reviewed by Cursor Bugbot for commit 0961a72. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant