Skip to content

feat(terminal): synchronize onOutput with buffer updates using onWriteParsed#16934

Open
Fangoling wants to merge 2 commits intoeclipse-theia:masterfrom
ls1intum:fix/useOnWriteParsed
Open

feat(terminal): synchronize onOutput with buffer updates using onWriteParsed#16934
Fangoling wants to merge 2 commits intoeclipse-theia:masterfrom
ls1intum:fix/useOnWriteParsed

Conversation

@Fangoling
Copy link
Contributor

@Fangoling Fangoling commented Feb 3, 2026

What it does

This implements the feature proposed in #16874.

Previously, the onOutput event fired immediately when write() or writeln() was called. This change buffers the output data and defers the event emission until xterm fires onWriteParsed.

This prevents race conditions by ensuring the onOutput event fires only after xterm has fully parsed and synchronized the buffer, rather than immediately upon the method call.

How to test

  1. Start theia with the flag --log-level=debug
  2. Type anything in the terminal
  3. Check in the browser console that the state of the terminal buffer that is logged is the same as the current terminal buffer
  4. Check in the browser console that the payload of the event equals your input

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Feb 3, 2026
@ndoschek
Copy link
Member

ndoschek commented Feb 6, 2026

Hi @Fangoling, could you add a few test instructions in the PR description please? TIA!

Signed-off-by: Fangxing Liu <fx.liu@tum.de>
@Fangoling Fangoling force-pushed the fix/useOnWriteParsed branch from 9468d5d to 977a081 Compare February 6, 2026 14:07
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
@Fangoling
Copy link
Contributor Author

Hi @Fangoling, could you add a few test instructions in the PR description please? TIA!

I added two logs on debug level to the event for testing purposes of this pr. I would remove them before the merge of this pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on reviewers

Development

Successfully merging this pull request may close these issues.

2 participants

Comments