Skip to content

Add CLI support for naming and renaming tabs#668

Merged
sbertix merged 8 commits into
supabitapp:mainfrom
adamgall:issue-659-cli-tab-titles
Jul 14, 2026
Merged

Add CLI support for naming and renaming tabs#668
sbertix merged 8 commits into
supabitapp:mainfrom
adamgall:issue-659-cli-tab-titles

Conversation

@adamgall

Copy link
Copy Markdown
Contributor

Closes #659

Summary

  • Add --title to supacode tab new so tabs can be named atomically when created.
  • Add supacode tab rename --title with worktree/tab environment defaults and empty-title clearing.
  • Reuse the persisted custom-title path, including title-lock validation, socket acknowledgements, confirmation handling, and restart persistence.
  • Update the CLI, deeplink, in-app, and generated agent reference surfaces.

Type of change

  • Bug fix (the linked issue is a bug report)
  • Feature (the linked issue is a feature request marked ready)
  • Documentation
  • Other (please describe)

How was this tested?

  • make check passes (format + lint)
  • make test passes
  • I built and ran the app to confirm the change works

Additional verification:

  • make build-app passes.
  • Focused tab manager, deeplink parser, reducer, socket acknowledgement, and persistence tests pass.
  • An isolated app/CLI smoke test covered titled creation, rename, empty-title clearing, context-menu interoperability, terminal-title fallback, and persistence across restart.
  • The full make test run completed with 2,452 passing tests, 13 expected failures, and one unrelated failure in PullRequestMergeQueueStatusTests/surfacesPositionAndEstimatedTime: ~10 min left versus ~10 mins left. That test passes when rerun alone.

AI tool disclosure (optional)

  • Model(s): OpenAI Codex GPT-5.6
  • Harness / tools: Supacode with the Oh My Pi coding harness

Checklist

  • This pull request is linked to an issue with Closes # above.
  • For a feature, the linked issue is labeled ready.
  • I am the author of this work and accountable for it; no commit is authored or co-authored by an AI agent.
  • I have read the Contributing guide and the Code of Conduct.

@adamgall adamgall marked this pull request as ready for review July 14, 2026 16:15
Make `supacode tab rename` acknowledge the outcome instead of the dispatch. The
rename now settles through a `tabRenamed` terminal event, so a tab closed between
the guard and the command reports a real error rather than exiting 0 having done
nothing.

Answer socket commands parked behind another command's confirmation dialog. A
dialog holds exactly one response fd, but the ack path skipped the response for
every command while any dialog was open. Those callers got no answer, and the app
leaked the client fd for the rest of its life since only the response closes it.

Reject tab titles that normalize away to nothing. Stripping control characters
from a title gave the reducer and the tab manager two notions of "blank", and the
weaker one guarded the door: `--title $'\e'` passed the check, normalized to nil,
and was acked as applied; on rename it also wiped the tab's existing title. Both
paths now gate on the tab manager's normalizer, keeping an empty title as the
deliberate way to clear the override. Control characters are stripped, but the
format characters that join emoji sequences survive.

Also:

- Alert when a terminal command's worktree vanishes mid-dispatch, so the CLI sees
  a failure instead of a silent ok. A confirmed `tab new` on a deleted worktree
  used to print the UUID of a tab that was never created.
- Skip the completion ack when the dispatch already failed, so the caller gets the
  error instead of hanging until the timeout.
- Stop `renameTab` from lazily resurrecting a pruned worktree's terminal state,
  and from persisting a layout when the rename did not apply.
- Honor the title lock on tab creation, so a locked tab cannot be given a custom
  title it can never clear.
- Document that script tabs have locked titles, fix the stale worktree-selection
  comments, and realign the tab block in the generated CLI skill.
@sbertix sbertix enabled auto-merge (squash) July 14, 2026 21:43

@sbertix sbertix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙇‍♂️

@sbertix sbertix merged commit 884c0f6 into supabitapp:main Jul 14, 2026
3 checks passed
@adamgall adamgall deleted the issue-659-cli-tab-titles branch July 15, 2026 00:00
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.

Add CLI support for naming and renaming tabs

2 participants