Skip to content

fix(desktop-terminal): follow alternate-screen switches in stream order - #10523

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/terminal-alt-screen-stream-order
Nov 30, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/terminal-alt-screen-stream-order

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Track alternate-screen switches per segment between shell markers, in stream order, alongside output capture
  • Fixes a read where one command ends and the next opens a full-screen program: the end marker's reset ran after the switch was tracked, so the tab reported nothing interactive (and an agent command would not resolve as interactive)
  • A program that enters the alternate screen and exits without leaving it still reports not interactive once its end marker arrives, same as when those land in separate reads

Type of Change

  • Bug fix

Testing

  • New session.test.ts case: fails on staging (expected false to be true), passes with the fix
  • bunx vitest run src/main/terminal in apps/desktop: 143 passed
  • apps/desktop tsc --noEmit, biome check on changed files

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)

Alternate-screen switches were tracked over a whole read before its shell
markers were applied, so when one command ended and the next entered the
alternate screen in the same read, the end marker's reset ran last and the
tab reported no full-screen program while one was open. Track each segment
between markers in order, the same way output is attributed.
@vercel

vercel Bot commented Nov 30, 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 10:02pm 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 2 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 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · This PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Updates TerminalSession to follow alternate-screen switches between shell markers, in stream order.

  • Terminal tabs stay interactive when a full-screen program starts between commands.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[PTY read] --> B[Parse text and shell markers]
  B --> C[Apply text before next marker]
  C --> D[Track screen switches and capture output]
  D --> E[Apply shell marker]
  E --> C
  E --> F[Apply remaining text]
  F --> G[Check whether the pending command is interactive]
Loading

Reviews (1) · Last reviewed commit: "fix(desktop-terminal): follow alternate-..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit f7a153f into staging Nov 30, 2026
50 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/terminal-alt-screen-stream-order branch November 30, 2026 22:05

This branch was previously deployed

1 inactive deployment
Preview — bbc8d20e 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