Allow disabling automatic reconstruction of terminals #2563 - #2850
Conversation
SougandhS
left a comment
There was a problem hiding this comment.
Works well ! 👍
Small suggestion..could we move this option to the top of the preference page ? The other settings (colors, buffer size) are all about how the terminal looks, but this one controls whether terminals come back at all after a restart, which feels more fundamental. Having it first would make it easier to find.
There was a problem hiding this comment.
Pull request overview
This PR adds a user preference in the Terminal preferences page to control whether previously-open terminals are automatically reconstructed when the Terminal view is reopened after an IDE restart (default: enabled), addressing the workflow pain described in #2563.
Changes:
- Adds a new boolean preference (
Reopen terminals after restart) to the terminal preference UI and initializes its default value. - Gates
TerminalsViewmemento restoration based on the new preference. - Updates bundle wiring/export metadata to allow the Terminal view bundle to read the preference from the Terminal control bundle (via
x-friends+@SuppressWarnings("restriction")).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/view/TerminalsView.java | Reads the new preference and conditionally skips restoring terminals from the view memento. |
| terminal/bundles/org.eclipse.terminal.view.ui/META-INF/MANIFEST.MF | Adds a dependency on org.eclipse.terminal.control to access preference infrastructure/constants. |
| terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/preferences/TerminalPreferencePage.java | Adds the checkbox field to the terminal preferences page. |
| terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/preferences/TerminalPreferenceInitializer.java | Defines the default value for the new preference. |
| terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/preferences/ITerminalConstants.java | Introduces the preference key and its default constant. |
| terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/control/impl/TerminalMessages.properties | Adds the user-visible label text for the new preference. |
| terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/control/impl/TerminalMessages.java | Adds the NLS field for the new preference label. |
| terminal/bundles/org.eclipse.terminal.control/META-INF/MANIFEST.MF | Adds x-friends to allow the view bundle to access internal preference/control packages. |
Suppressed comments (1)
terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/view/TerminalsView.java:719
restoreState()reads frompreferenceStorewithout ensuring it has been initialized or thatTerminalPlugin.getDefault()is non-null. Given other code in this component defensively checksTerminalPlugin.getDefault() != null, this should be null-safe to avoid NPEs in early-startup or test scenarios.
@SuppressWarnings("restriction")
public void restoreState(IMemento memento) {
if (memento == null || !preferenceStore.getBoolean(ITerminalConstants.PREF_RESTORE_TERMINALS)) {
return;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…m#2563 This change adds a preference to disable automatically restoring the open terminals in the terminal view. Fixes eclipse-platform#2563
b024dc2 to
3070afe
Compare
Done in 3070afe. |
|
Thanks. Please add N&N. |
Summary
This PR adds a preference to disable automatically restoring the open terminals in the terminal view.
Demonstration steps:
This PR adds a new preference in Window > Preferences > Terminal named
Reopen terminals after restartwhich is checked by default. If unchecked, no terminals will be restored.Notes
org.eclipse.terminal.controlwhile the related logic is present inorg.eclipse.terminal.view.ui. I don't know what the best way to expose these classes is as they arex-internal. For now, I added anx-friends(mainly for documentation) and marked the access with@SuppressWarnings("restriction").org.eclipse.cdt.core.nativeandorg.eclipse.cdt.core.<your OS/arch>bundles. I got them from the update sitehttps://download.eclipse.org/releases/2026-09. This PR can still be tested without that but local terminals might just be empty rectangles without those.Issues
Fixes #2563