Skip to content

feat(tui): add /titleon and /titleoff to toggle session title in the footer#2019

Open
go-bananas-wwj wants to merge 3 commits into
MoonshotAI:mainfrom
go-bananas-wwj:feat/footer-session-title-toggle
Open

feat(tui): add /titleon and /titleoff to toggle session title in the footer#2019
go-bananas-wwj wants to merge 3 commits into
MoonshotAI:mainfrom
go-bananas-wwj:feat/footer-session-title-toggle

Conversation

@go-bananas-wwj

Copy link
Copy Markdown

Related Issue

Resolve #2018

Problem

See linked issue. In short: sessions forked from the same conversation are hard to tell apart when switching in the terminal, and the current session's title — even after renaming with /title — is never visible while you work, because the footer only shows the working directory and git branch.

What changed

Two new built-in slash commands, /titleon and /titleoff, toggle whether the TUI footer shows the current session title right after the git branch badge:

K3 thinking: high  ~/work/kimi-code  main  fix-auth-flow
  • The toggle is a session-only AppState flag (showSessionTitleInFooter, default off, not persisted to tui.toml). It resets at session boundaries (switch / /new / fork / logout) but survives /reload within the same session.
  • The title is rendered with the existing footer idioms: two-space separator, colors.textDim (same as the cwd), and a 40-column width-aware cap via truncateToWidth so CJK titles cannot crowd the status bar.
  • Renames through /title update the footer live via the existing sessionTitle state — no new data flow.
  • Session-only is deliberate: this is a "which conversation am I in right now" aid, not a long-term UI preference. Happy to persist it in tui.toml if maintainers prefer.

Two separate commands rather than /title on|off because /title <text> already sets the title verbatim, so /title on would be ambiguous (see the issue for the discussion — open to reshaping).

Tests: footer rendering cases (on/off, after cwd, after git badge, null title, 40/41-column boundary, CJK width), command handler tests (patch, telemetry, status message, idempotency), and lifecycle tests (reset on switch/new, preserved across /reload). Docs updated in docs/en and docs/zh. Changeset included.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

…footer

Add two built-in slash commands that toggle whether the footer status
bar shows the current session title after the cwd and git branch badge:

- /titleon: show the session title in the footer (session-only)
- /titleoff: hide it again (default)

The toggle lives in AppState (not persisted to tui.toml): it resets on
session switch / new / fork / logout, but survives /reload within the
same session. The title is capped at 40 display columns with
truncateToWidth so CJK titles cannot crowd the status bar, and renames
via /title update the footer live through the existing
sessionTitle state.

Refs MoonshotAI#2018
@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9482bd3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df6fed1905

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/components/chrome/footer.ts Outdated
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.

Feature request: show the current session title in the TUI footer (proposed /titleon and /titleoff)

1 participant