Skip to content

fix(tui): sanitize background task output - #2863

Open
LouisDM wants to merge 1 commit into
MoonshotAI:mainfrom
LouisDM:codex/issue-2233-task-output-sanitize
Open

fix(tui): sanitize background task output#2863
LouisDM wants to merge 1 commit into
MoonshotAI:mainfrom
LouisDM:codex/issue-2233-task-output-sanitize

Conversation

@LouisDM

@LouisDM LouisDM commented Aug 12, 2026

Copy link
Copy Markdown

Related Issue

Refs #2233

Problem

Background task output is rendered directly inside the /tasks preview and full output viewer. Shell output can contain carriage returns and cursor-control sequences; when those bytes reach a framed pane, the terminal can move the cursor and overwrite pane borders. This matches the split-pane corruption reported on Windows Terminal.

What changed

  • sanitize captured task output at both framed TUI sinks using the existing sanitizeShellOutput helper
  • add regressions for carriage-return progress output and CSI clear-screen sequences in both views
  • add a patch changeset for @moonshot-ai/kimi-code

Verification

  • pnpm exec vitest run apps/kimi-code/test/tui/tasks-browser.test.ts apps/kimi-code/test/tui/task-output-viewer.test.ts (61 passed)
  • pnpm exec vitest run apps/kimi-code/test/tui/utils/shell-output.test.ts (17 passed)
  • pnpm --filter @moonshot-ai/kimi-code typecheck
  • type-aware oxlint on all four changed TypeScript files
  • pnpm changeset status --since origin/main
  • git diff --check

The byte-level regression is deterministic in a headless terminal. Native Windows Terminal split-pane validation remains useful during review.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove the fix works.
  • Ran gen-changesets and added a patch changeset.
  • Ran gen-docs; this fix does not require a documentation update.

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: de04114

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

@LouisDM
LouisDM marked this pull request as ready for review August 13, 2026 10:09
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.

1 participant