Repository navigation
Add terminal-only mode and UI adjustments - #294035
Daryl (darylcecile) wants to merge 2 commits into
Conversation
Introduce a terminal-only mode driven by a new --terminal CLI flag and environmentService. Adds 'terminal' to NativeParsedArgs and OPTIONS (-t alias) and exposes terminal on browser/electron/common environment services. Introduces TerminalModeContext and uses it across workbench to adjust behavior: hide editors/activity/side/auxiliary bars, force panel visibility/focus, block panel hiding/showing of auxiliary bar, hide non-terminal panel view containers, suppress panel title actions, and disable command center and startup page in terminal mode. Adds a .terminal-mode CSS class to hide per-composite toolbar/global actions. Also expands AGENTS.md with build, test, style and contributor guidance.
There was a problem hiding this comment.
Pull request overview
Adds an experimental “terminal-only” workbench mode that can be launched via a new --terminal (-t) CLI flag, and propagates that mode through environment services + a context key to adjust UI/behavior across the workbench.
Changes:
- Introduces
--terminal/-tCLI option and plumbs it throughNativeParsedArgsand workbench environment services (environmentService.terminal). - Adds
TerminalModeContext(isTerminalMode) and uses it to hide/disable panel title actions and other UI (eg command center, startup page). - Adjusts layout/runtime state and CSS to hide non-terminal UI surfaces and enforce panel focus/visibility in terminal mode.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/environment/common/argv.ts | Adds terminal to NativeParsedArgs. |
| src/vs/platform/environment/node/argv.ts | Registers --terminal / -t CLI option. |
| src/vs/workbench/services/environment/common/environmentService.ts | Extends IWorkbenchEnvironmentService with terminal: boolean. |
| src/vs/workbench/services/environment/browser/environmentService.ts | Exposes terminal via browser payload. |
| src/vs/workbench/services/environment/electron-browser/environmentService.ts | Exposes terminal via native CLI args. |
| src/vs/workbench/common/contextkeys.ts | Introduces TerminalModeContext context key. |
| src/vs/workbench/browser/contextkeys.ts | Binds TerminalModeContext from environmentService.terminal. |
| src/vs/workbench/browser/layout.ts | Applies terminal-mode layout defaults, focus behavior, CSS class, and blocks panel/auxbar toggles. |
| src/vs/workbench/browser/parts/paneCompositeBar.ts | Hides non-terminal panel view containers in terminal mode. |
| src/vs/workbench/browser/parts/panel/panelActions.ts | Suppresses panel title actions (hide/maximize) in terminal mode via context key. |
| src/vs/workbench/browser/parts/panel/media/panelpart.css | Hides panel title toolbars/global actions under .terminal-mode. |
| src/vs/workbench/browser/parts/titlebar/titlebarPart.ts | Disables Command Center visibility in terminal mode. |
| src/vs/workbench/contrib/welcomeGettingStarted/browser/startupPage.ts | Disables startup page in terminal mode. |
| 'remove': { type: 'boolean', cat: 'o', args: 'folder', description: localize('remove', "Remove folder(s) from the last active window.") }, | ||
| 'goto': { type: 'boolean', cat: 'o', alias: 'g', args: 'file:line[:character]', description: localize('goto', "Open a file at the path on the specified line and character position.") }, | ||
| 'new-window': { type: 'boolean', cat: 'o', alias: 'n', description: localize('newWindow', "Force to open a new window.") }, | ||
| 'terminal': { type: 'boolean', cat: 'o', alias: 't', description: localize('terminal', "Open a terminal window.") }, |
There was a problem hiding this comment.
The CLI help text "Open a terminal window." is ambiguous given this flag enables terminal-only mode (per PR description). It would be clearer to describe that it opens a terminal-only window (no editor UI), to avoid confusion with simply toggling the integrated terminal in a normal window.
| MenuRegistry.appendMenuItem(MenuId.PanelTitle, { | ||
| command: { | ||
| id: TogglePanelAction.ID, | ||
| title: localize('closePanel', 'Hide Panel'), | ||
| icon: closeIcon | ||
| }, | ||
| group: 'navigation', | ||
| order: 2 | ||
| order: 2, | ||
| when: TerminalModeContext.negate() | ||
| }); |
There was a problem hiding this comment.
Hiding the PanelTitle menu item via when: TerminalModeContext.negate() helps, but TogglePanelAction is still f1: true (and has keybinding) so it remains available in the Command Palette in terminal mode where it becomes a no-op due to the layout guard. Consider adding a precondition/when to the action (and/or its keybinding/menu entries) so the command is disabled/hidden in terminal mode rather than silently doing nothing.
|
@microsoft-github-policy-service agree |
Co-authored-by: Copilot <[email protected]>
Daniel Imms (Tyriar)
left a comment
There was a problem hiding this comment.
This is cool but it's a pretty long way off the changes that would actually be needed to accomplish this. What this does is forcefully strips away some functionality based on some args which isn't good for the codebase in the long term. My hope is that such a feature would actually launch basically an existing "Terminal Window" which you can open with this command:
This will open the terminal in a special minimal state, the downside being you can't launch it via the CLI and it needs to come from a parent workbench window:
|
Oh Thank you, i missed the window option! I'll have another go :) |
|
Thanks for the PR. As discussed, this approach strips down the main workbench instead of building on the existing Terminal Window architecture. Closing this draft, while the broader feature request remains tracked in #34442. Please let us know if you think this is incorrect or are still interested in another attempt! |

[EXPERIMENTAL] #34442
What
Introduce a terminal-only mode driven by a new --terminal CLI flag and environmentService. Adds 'terminal' to NativeParsedArgs and OPTIONS (-t alias) and exposes terminal on browser/electron/common environment services.
Why
Im a fan of the vscode terminal and wish there was a way i could open just that minus all the other distractions. Now I can do
code --terminal.How
Using existing features (ContextKeyExpr, LayoutClasses, shouldBeHidden, etc.) and guards to disable the "other distractions" and only showing the terminal. Loads everything else as normal so in theory everything else should still work. Introduces TerminalModeContext and uses it across workbench to adjust behavior: hide editors/activity/side/auxiliary bars, force panel visibility/focus, block panel hiding/showing of auxiliary bar, hide non-terminal panel view containers, suppress panel title actions, and disable command center and startup page in terminal mode. Adds a
.terminal-modeCSS class to hide per-composite toolbar/global actions.Important
This is more a proof of concept (and for personal use) at this stage. I have not tested the impact of this on the rest of the codebase 🤷🏽