Skip to content

fix(terminal): implement correct and secure TerminalBuffer.getLines()#16975

Draft
Fangoling wants to merge 4 commits intoeclipse-theia:masterfrom
ls1intum:feat/improve-terminal-buffer-read-line
Draft

fix(terminal): implement correct and secure TerminalBuffer.getLines()#16975
Fangoling wants to merge 4 commits intoeclipse-theia:masterfrom
ls1intum:feat/improve-terminal-buffer-read-line

Conversation

@Fangoling
Copy link
Contributor

@Fangoling Fangoling commented Feb 11, 2026

What it does

Fixes: #16971
Changes to the terminal buffer implementation:

  • Utilizes start parameter

  • Returns empty array if the start parameter is out of bounds

  • Checks if the line is null before calling translate to String

  • Add optional parameter trimRight to allow the user to trim whitespace at the end of each line

  • Fixes the call to getLines in terminal-main.ts in the plugin ext extension: it was previously expecting the output of the terminal extension to be in chronological error, which did not fail as the start parameter was not used

How to test

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

Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Feb 11, 2026
Signed-off-by: Fangxing Liu <fx.liu@tum.de>
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.

[terminal] Refactor TerminalBufferImpl.getLines for Correctness and Safety

1 participant

Comments