Skip to content

fix(desktop-terminal): keep a fast command's output when its start and end markers share a read - #10504

Open
waleedlatif1 wants to merge 2 commits into
stagingfrom
fix/terminal-same-chunk-output
Open

waleedlatif1 wants to merge 2 commits into
stagingfrom
fix/terminal-same-chunk-output

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The terminal session applied every shell marker in a PTY chunk before looking at the chunk's text, so when a quick command's start marker, output and end marker arrived in one read, terminal_run returned completed with empty output (and text before a start marker could be captured as output)
  • The shell-integration parser now reports where each marker fell in the text, and the session attributes text to the command in stream order
  • Surfaced as an intermittent desktop-release smoke failure in browser-tools.spec.ts ("runs the command Sim authorized…": exit 0, 6 ms, empty output)

Type of Change

  • Bug fix

Testing

New session.test.ts case feeds one chunk carrying echo, start marker, output, cwd, end marker and prompt; it fails on the old code (output "") and passes now. All 141 terminal unit tests pass; desktop type-check, biome, check:test-patterns, check:comment-hygiene. desktop-e2e runs in CI.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…d end markers share a read

The session applied every shell marker in a PTY chunk before looking at the
chunk's text. When a quick command's start marker, output and end marker
arrived in one read, the command finished before its text was examined, so
terminal_run returned completed with empty output. Marker offsets now place
each piece of text before or after the markers around it.
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 30, 2026 12:32am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The latest changes appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge.

Summary

Keeps command output between its start and finish markers, even when both arrive in one read.

  • Fast terminal commands keep their output when markers share a read.

Reviews (3) · Last reviewed commit: "fix(desktop-terminal): judge a full-scre..." · Reviewed by Greptile

@greptile-apps

This comment has been minimized.

…le read is applied

A program that opened and closed the alternate screen and finished within one
read was resolved as interactive before its finish marker ran. Interactive
resolution now waits until every marker in the read is applied and requires
the alternate screen to still be held.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

Turn on auto-fix | Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — 7d4012d2 Deployed Nov 30, 2026 by vercel[bot]
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