Unused/obsolete code in XtermEngine #21724

Open
opened 2026-01-31 07:53:10 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (May 16, 2024).

In the XtermEngine::StartPaint method, there's some code that calculates the dirty area here:
183a8956f6/src/renderer/vt/XtermEngine.cpp (L85-L97)

However, the result of that calculation is not actually used. There was a time when there was more code in that branch that compared the dirty area against the last viewport, but that was removed in PR #4741.


And in the XtermEngine::_MoveCursor method there's a local variable performedSoftWrap which is initially set to false at the start of the method here:

183a8956f6/src/renderer/vt/XtermEngine.cpp (L249-L249)

And it's potentially changed to true later in the code:

183a8956f6/src/renderer/vt/XtermEngine.cpp (L273-L278)

However, the variable is otherwise never read. It looks like it was added as part of PR #5181, but even then it doesn't appear to have been used.

Unless there is something I'm missing, I'd suggest we should remove the unused code.

Originally created by @j4james on GitHub (May 16, 2024). In the `XtermEngine::StartPaint` method, there's some code that calculates the dirty area here: https://github.com/microsoft/terminal/blob/183a8956f699e1967d4cb4712184d0dbc395a0e5/src/renderer/vt/XtermEngine.cpp#L85-L97 However, the result of that calculation is not actually used. There was a time when there was more code in that branch that compared the dirty area against the last viewport, but that was removed in PR #4741. --- And in the `XtermEngine::_MoveCursor` method there's a local variable `performedSoftWrap` which is initially set to false at the start of the method here: https://github.com/microsoft/terminal/blob/183a8956f699e1967d4cb4712184d0dbc395a0e5/src/renderer/vt/XtermEngine.cpp#L249-L249 And it's potentially changed to true later in the code: https://github.com/microsoft/terminal/blob/183a8956f699e1967d4cb4712184d0dbc395a0e5/src/renderer/vt/XtermEngine.cpp#L273-L278 However, the variable is otherwise never read. It looks like it was added as part of PR #5181, but even then it doesn't appear to have been used. Unless there is something I'm missing, I'd suggest we should remove the unused code.
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 07:53:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21724