Skip to content

TUI: add /rename to rename the current session (prefilled inline editor, /name alias, bindable shortcut) #1738

Description

@code-yeongyu

Summary

The interactive TUI has no /rename command. Renaming the current session today requires knowing the /name <name> command; there is no argument-less form that lets you edit the existing name, and no main-editor keybinding action for it. OpenCode ships /rename (a prefilled rename prompt, plus a session_rename keybind) and users coming from it expect the same verb. This issue tracks giving the TUI a first-class /rename for the current session, keeping /name as an alias.

Reproduction

  1. senpi (or omo) in any project, send one prompt so a session exists.
  2. Type /rename — autocomplete offers nothing; submitting it reports an unknown command and the text is sent nowhere useful.
  3. Type /name with no argument — it only prints the current name or Usage: /name <name>; there is no way to edit the existing name in place.
  4. /hotkeys lists no action for renaming the current session from the main editor (app.session.rename only works inside the /resume picker).

Expected (ideal state / acceptance criteria)

  • /rename [name] is a builtin slash command: listed in BUILTIN_SLASH_COMMANDS with an argument hint, offered by autocomplete, shown by /hotkeys and help.
  • /rename <name> sets the session display name with the same normalization /name applies today (newlines collapsed, trimmed), prints Session name set: <name> in the chat, and the footer shows the new name immediately.
  • /rename with no argument opens an inline rename editor prefilled with the current session name (OpenCode DialogSessionRename parity): Enter commits, Escape cancels, a whitespace-only submit warns Session name cannot be empty and appends no session_info entry, and an unchanged name is a no-op (no new session_info entry).
  • /name keeps working as a backward-compatible alias that shares the same handler; its description says it is an alias of /rename. README, docs/usage.md, docs/sessions.md and the session tip name /rename as the canonical command.
  • A keybinding action app.session.renameCurrent (unbound by default, like app.session.new/tree/fork/resume; description "Rename the current session") is registered on the default editor and opens the same inline editor, so users can bind a key for it.
  • The RPC (set_session_name) and app-server (thread/name/set) surfaces are unchanged; remote/host runtimes work because the handler goes through session.setSessionName.
  • Tests under packages/coding-agent/test/suite/ cover the command, the alias, the inline editor commit/cancel/empty paths and the keybinding registration; changes.md trackers and the [Unreleased] changelog are updated so the changelog gate passes.

Actual

  • /rename is unknown to the TUI.
  • /name exists (packages/coding-agent/src/core/slash-commands.ts:30, handler interactive-mode.ts handleNameCommand) but has no prefilled edit form.
  • app.session.rename (ctrl+r) is scoped to the /resume session selector (components/session-selector.ts); in the main editor ctrl+r is app.history.search, so the OpenCode default cannot be reused globally.

Evidence

  • packages/coding-agent/src/core/slash-commands.ts:19-44 — builtin list, name present, no rename.
  • packages/coding-agent/src/modes/interactive/interactive-mode.ts:4769/name intercept; handleNameCommand prints usage when the argument is empty.
  • packages/coding-agent/src/core/keybindings.ts:125app.history.search = ctrl+r; :163-166 — main-editor session actions default to []; :195app.session.rename = ctrl+r (selector only).
  • OpenCode reference: packages/tui/src/routes/session/index.tsx (session.rename command with slash: { name: "rename" }), packages/tui/src/component/dialog-session-rename.tsx, packages/tui/src/config/keybind.ts (session_rename: ctrl+r).

Root cause

Feature gap: the session-name API exists (SessionManager.appendSessionInfo, AgentSession.setSessionName, session_info_changed event) but the TUI only exposes it through /name <name>.

Scope

In: builtin /rename, inline prefilled editor, /name alias, app.session.renameCurrent keybinding action, help/hotkeys/tips/docs, tests, trackers, changelog.
Out: renaming other sessions from the main editor (already possible inside /resume), RPC/app-server protocol changes, desktop app work (tracked in the omo-desktop-app repo).

Related

  • Desktop counterpart: omo-desktop-app issue (linked in the first comment).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions