Skip to content

fix(tui): cap session-title length at 32 chars - #158

Merged
liruifengv merged 1 commit into
MoonshotAI:mainfrom
caigee-cmd:fix/issue-128-cap-session-title
May 28, 2026
Merged

fix(tui): cap session-title length at 32 chars#158
liruifengv merged 1 commit into
MoonshotAI:mainfrom
caigee-cmd:fix/issue-128-cap-session-title

Conversation

@caigee-cmd

Copy link
Copy Markdown
Contributor

Related Issue

Resolve #128

Problem

See linked issue. On Windows Terminal the session title written by Kimi Code can stretch the tab bar past readable width — at the current 80-character cap, CJK content reaches ~160 terminal columns and ASCII content shows the entire first user message inline.

This PR addresses the tab-width side of the report. The second concern in the issue — pasted code is unreadable as a title regardless of length — is not addressed here; both suggested directions in the issue (skip the OSC title override entirely, or summarize the first message via the model) are larger behavior changes that benefit from maintainer input first.

What changed

MAX_PROCESS_TITLE_LENGTH is lowered from 80 to 32 in apps/kimi-code/src/tui/constant/terminal.ts. The slicing in setProcessTitle (apps/kimi-code/src/tui/utils/proctitle.ts) already honors the constant, so no other code change is required. The new cap fits typical tab widths (~20–25 visible characters in Windows Terminal / iTerm tab bars) while keeping enough context to identify the session.

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.

@changeset-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ade4680

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 Patch

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

@pkg-pr-new

pkg-pr-new Bot commented May 28, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@ade4680
npx https://pkg.pr.new/@moonshot-ai/kimi-code@ade4680

commit: ade4680

@liruifengv liruifengv 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.

LGTM!

@liruifengv
liruifengv merged commit d1f9a83 into MoonshotAI:main May 28, 2026
7 checks passed
@github-actions github-actions Bot mentioned this pull request May 28, 2026
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.

会话标签默认显示用户第一条原始消息,长文本/粘贴内容时显示异常

2 participants