GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): strip ANSI codes from extension session names by markjoin123 · Pull Request #1413 · JetBrains/thinkrail

Conversation

@markjoin123

@markjoin123 markxu (markjoin123) commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Problem

An extension that names a chat with pi.setSessionName("\x1b[31mred\x1b[0m name") shows the raw escape bytes in the chat title and the session list, including after reload. #1353 strips escapes from text the ext-UI bridge displays, including ctx.ui.setTitle. A session name does not go through that bridge: pi stores it on the session file as session_info, and the host reads it back from the live event, the session records, and the history index.

Approach

Strip escapes where the name is read, so a name already saved by an older build shows up plain. The session file is not rewritten, and the 80-character write cap stays on renameSession only.

stripAnsi moved to @thinkrail/shared/stripAnsi. history cannot import agent, and both modules read the title. Display reads are the forwarded session_info_changed event, every session summary and state-record title (including a disk list row's SessionInfo.name), and the title extractSession takes from session_info. A name that is only escapes is treated as a clear. A visible title longer than 80 characters is kept.

Changes

  • Shared stripAnsi / plainText, used by the ext-UI bridge and by session-title reads.
  • Live rename, session list, state records, and history titles drop terminal escapes.
  • Regression tests for a live pi.setSessionName, a name already on disk, and a coloured title past the write cap. The on-disk session_info name is still the original string.

Screenshots

Not applicable — no frontend changes. The page already renders the title string the host sends.

Related issues

Fixes #1374

Checklist

  • Fast gates pass: bun run lint, bun run typecheck, bun run test
  • E2E suite passes for app-affecting changes (bun run e2e, or bun run e2e:full when touching agent behavior)
  • Before/after screenshots are included for frontend changes, or marked not applicable
  • Relevant SPEC.md / top-level specs updated to reflect any boundary, contract, or behavior change
  • I have read the Contributing guide and agree to the Code of Conduct

The lint, typecheck, and new session-title tests passed. One existing @thinkrail/server test (pushBranch reftable workspace) failed because this environment's Git has no git refs; it is unrelated to session titles. E2E was not run: the page did not change, and the live and reload paths are covered by the server tests.

This change was made with AI assistance and reviewed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@markjoin123
fix(server): strip ANSI codes from extension session names
b6e6168
Fixes JetBrains#1374
@markjoin123
markxu (markjoin123) requested review from Andrey Markin (Mark-Life), Olga Lavrichenko (OLavrik), artyomxx, danyaberezun and Rinat S (rsolmano) as code owners November 16, 2026 13:25
jetbrains-air[bot]
jetbrains-air Bot approved these changes Nov 16, 2026
View reviewed changes

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Approved — ready to merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
danyaberezun added 2 commits November 18, 2026 13:16
@danyaberezun
Merge remote-tracking branch 'origin/main' into pr1413-fix
8844866
@danyaberezun
docs(server): record the ANSI strip's behaviour once, in the shared spec
2b8fcc3
jetbrains-air[bot]
jetbrains-air Bot approved these changes Nov 18, 2026
View reviewed changes

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Approved — ready to merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
danyaberezun
danyaberezun approved these changes Nov 18, 2026
View reviewed changes
@danyaberezun
danyaberezun added this pull request to the merge queue Nov 18, 2026
@danyaberezun

danyaberezun commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks markxu (@markjoin123) — verified that every read path a user sees is covered and that stripping is idempotent across the live event, summaries and the history index. I pushed one docs commit on top so the strip's behaviour and the reasons the built-ins don't fit are recorded once, in packages/shared/SPEC.md, with the agent spec pointing there (AGENTS.md: specs don't restate each other). Merging via the queue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Merged via the queue into JetBrains:main with commit 52ea03b Nov 18, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Chong Jiang (Bouchee) added a commit to Bouchee/DesignRail that referenced this pull request Nov 23, 2026
@Bouchee
fix(agent): strip terminal escapes from session titles
5bde6f8
Adapt ThinkRail JetBrains#1413 (52ea03b) to RailDesign title and search handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@danyaberezun danyaberezun danyaberezun approved these changes
@jetbrains-air jetbrains-air[bot] jetbrains-air[bot] approved these changes
@rsolmano Rinat S (rsolmano) Awaiting requested review from rsolmano rsolmano is a code owner
@OLavrik Olga Lavrichenko (OLavrik) Awaiting requested review from OLavrik
@artyomxx artyomxx Awaiting requested review from artyomxx
@Mark-Life Andrey Markin (Mark-Life) Awaiting requested review from Mark-Life

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Extension chat names set with pi.setSessionName show raw terminal escape codes

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@markjoin123 @danyaberezun
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.