Skip to content

Add CLI support for naming and renaming tabs #659

Description

@adamgall

What problem does this solve?

Supacode already lets users assign a persistent custom title to a terminal tab through Rename Tab (via right-click context menu), but the CLI cannot name a tab when creating it or rename an existing tab.

Scripts can create and target tabs by UUID, yet cannot give those tabs stable role-based names. For example, a repository setup script may create a repeatable layout with scratch, implement, git, and review tabs. It can capture every ID returned by supacode tab new, but the resulting tabs still have to be renamed manually.

A terminal/OSC title is not an equivalent workaround: it is process-controlled, may change while a command is running, and is distinct from Supacode's persisted customTitle override.

Proposed solution

Give tab creation and tab renaming equal support in the CLI.

Name a tab atomically when creating it:

implement_tab="$(supacode tab new \
  -w "$SUPACODE_WORKTREE_ID" \
  --title "implement" \
  -i "omp")"

Rename an existing tab:

supacode tab rename \
  -w "$SUPACODE_WORKTREE_ID" \
  -t "$tab_id" \
  --title "review"

Both operations should use the same persistent custom-title behavior as the existing UI action. Specifically:

  • supacode tab new --title <title> should set the new tab's customTitle as part of creation.
  • supacode tab rename --title <title> should update an existing tab's customTitle.
  • -w and -t should default from SUPACODE_WORKTREE_ID and SUPACODE_TAB_ID wherever applicable, consistent with the other tab commands.
  • The custom title should survive terminal title changes and app restarts.
  • Renaming with an empty title should clear the custom-title override, matching the existing model behavior.
  • Both operations should return the normal CLI acknowledgement or a useful error when the worktree or tab does not exist.
  • Both operations should participate in the existing automated-action confirmation policy.

Alternatives considered

  • Rename tabs manually through the context menu: works, but cannot be used by repository setup scripts that create a standard layout.

Supacode version

0.10.6

Are you planning to build this yourself?

  • I intend to open a pull request once this is approved and marked ready.

Before submitting

  • I searched existing issues and this is not a duplicate.
  • I understand feature pull requests are closed until the issue is marked ready.
  • I agree to follow this project's Code of Conduct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestreadyApproved for a pull request. Added by a maintainer once an issue is triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions