Skip to content

Commit 9237441

Browse files
authored
Add terminal as a startup editor (microsoft#203567)
1 parent ac56e6e commit 9237441

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,14 @@ configurationRegistry.registerConfiguration({
305305
'workbench.startupEditor': {
306306
'scope': ConfigurationScope.RESOURCE,
307307
'type': 'string',
308-
'enum': ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench'],
308+
'enum': ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench', 'terminal'],
309309
'enumDescriptions': [
310310
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.none' }, "Start without an editor."),
311311
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePage' }, "Open the Welcome page, with content to aid in getting started with VS Code and extensions."),
312312
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.readme' }, "Open the README when opening a folder that contains one, fallback to 'welcomePage' otherwise. Note: This is only observed as a global configuration, it will be ignored if set in a workspace or folder configuration."),
313313
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.newUntitledFile' }, "Open a new untitled text file (only applies when opening an empty window)."),
314314
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePageInEmptyWorkbench' }, "Open the Welcome page when opening an empty workbench."),
315+
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.terminal' }, "Open a new terminal in the editor area."),
315316
],
316317
'default': 'welcomePage',
317318
'description': localize('workbench.startupEditor', "Controls which editor is shown at startup, if none are restored from the previous session.")

src/vs/workbench/contrib/welcomeGettingStarted/browser/startupPage.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { ILogService } from 'vs/platform/log/common/log';
2828
import { INotificationService } from 'vs/platform/notification/common/notification';
2929
import { localize } from 'vs/nls';
3030
import { IEditorResolverService, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService';
31+
import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal';
3132

3233
export const restoreWalkthroughsConfigurationKey = 'workbench.welcomePage.restorableWalkthroughs';
3334
export type RestoreWalkthroughsConfigurationValue = { folder: string; category?: string; step?: string };
@@ -126,6 +127,8 @@ export class StartupPageContribution implements IWorkbenchContribution {
126127
await this.openReadme();
127128
} else if (startupEditorSetting.value === 'welcomePage' || startupEditorSetting.value === 'welcomePageInEmptyWorkbench') {
128129
await this.openGettingStarted();
130+
} else if (startupEditorSetting.value === 'terminal') {
131+
this.commandService.executeCommand(TerminalCommandId.CreateTerminalEditor);
129132
}
130133
}
131134
}
@@ -213,5 +216,6 @@ function isStartupPageEnabled(configurationService: IConfigurationService, conte
213216

214217
return startupEditor.value === 'welcomePage'
215218
|| startupEditor.value === 'readme' && (startupEditor.userValue === 'readme' || startupEditor.defaultValue === 'readme')
216-
|| (contextService.getWorkbenchState() === WorkbenchState.EMPTY && startupEditor.value === 'welcomePageInEmptyWorkbench');
219+
|| (contextService.getWorkbenchState() === WorkbenchState.EMPTY && startupEditor.value === 'welcomePageInEmptyWorkbench')
220+
|| startupEditor.value === 'terminal';
217221
}

0 commit comments

Comments
 (0)