Conversation
Dragging a terminal tab to another terminals view recreates the terminal controls in the new view. This failed in two ways: - The text line renderer of the new canvas measured the font on fCtlText, which at that point still is the canvas that was just disposed. The move stopped with "Widget is disposed", leaving the tab behind and both terminals blank. - The preferences were only applied to freshly created terminals, so a moved terminal fell back to the default colors and font. The renderer now measures on the display while the new canvas does not exist yet, and the preferences are applied to recreated controls too.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Test teardown leaks terminal resources, and both modified plug-ins require bundle version increments.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Fixes terminal tab migration between terminal views by safely recreating controls and preserving preferences.
Changes:
- Avoids measuring fonts against a disposed canvas.
- Reapplies terminal preferences after control recreation.
- Adds UI regression coverage for recreation and preference retention.
| File | Description |
|---|---|
AutomatedTestSuite.java |
Registers the new UI test. |
TerminalControlRecreateUITest.java |
Tests control recreation and preference retention. |
VT100TerminalControl.java |
Fixes recreation and reapplies preferences. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
As the terminals view does when a terminal tab is closed, so the terminal does not stay registered in the font registry after the test.
TextCanvas.getTerminalBackgroundColor() is protected: in OSGi the test bundle is another runtime package, so the test failed with an IllegalAccessError. The renderer's getDefaultBackgroundColor() is public.


Dragging a terminal tab to another terminals view (the view's "New Terminal View" button, then drag a tab across) currently fails:
SWTException: Widget is disposed, thrown fromStyleMap.updateFontviaVT100TerminalControl.setupTerminal.Cause
setupTerminal(Composite)recreates the controls in the new parent. TheTextLineRendererof the new canvas measures the font onfCtlText, but at that pointfCtlTextis still the canvas that was just disposed.A second problem shows once that is fixed: the preferences (colors, font, buffer size) were only applied to freshly created terminals, so a moved terminal fell back to the default colors and font.
Fix
setupTerminalapplies the preferences to recreated controls too. The property change listener is still added only once.Test
TerminalControlRecreateUITestrecreates a terminal in a new parent, as the drag and drop does:The existing terminal tests pass.