Skip to content

Commit aaebb15

Browse files
authored
Merge pull request microsoft#183424 from microsoft/tyriar/180097
Improve terminal profile config help
2 parents dc626ba + 35b01aa commit aaebb15

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

src/vs/platform/terminal/common/terminalPlatformConfiguration.ts

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { getAllCodicons } from 'vs/base/common/codicons';
77
import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';
8-
import { OperatingSystem } from 'vs/base/common/platform';
8+
import { OperatingSystem, Platform, PlatformToString } from 'vs/base/common/platform';
99
import { localize } from 'vs/nls';
1010
import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
1111
import { Registry } from 'vs/platform/registry/common/platform';
@@ -93,6 +93,21 @@ const terminalAutomationProfileSchema: IJSONSchema = {
9393
}
9494
};
9595

96+
function createTerminalProfileMarkdownDescription(platform: Platform.Linux | Platform.Mac | Platform.Windows): string {
97+
const key = platform === Platform.Linux ? 'linux' : platform === Platform.Mac ? 'osx' : 'windows';
98+
return localize(
99+
{
100+
key: 'terminal.integrated.profile',
101+
comment: ['{0} is the platform, {1} is a code block, {2} and {3} are a link start and end']
102+
},
103+
"A set of terminal profile customizations for {0} which allows adding, removing or changing how terminals are launched. Profiles are made up of a mandatory path, optional arguments and other presentation options.\n\nTo override an existing profile use its profile name as the key, for example:\n\n{1}\n\n{2}Read more about configuring profiles{3}.",
104+
PlatformToString(platform),
105+
'```json\n"terminal.integrated.profile.' + key + '": {\n "bash": null\n}\n```',
106+
'[',
107+
'](https://code.visualstudio.com/docs/terminal/profiles)'
108+
);
109+
}
110+
96111
const shellDeprecationMessageLinux = localize('terminal.integrated.shell.linux.deprecation', "This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.", '`#terminal.integrated.profiles.linux#`', '`#terminal.integrated.defaultProfile.linux#`');
97112
const shellDeprecationMessageOsx = localize('terminal.integrated.shell.osx.deprecation', "This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.", '`#terminal.integrated.profiles.osx#`', '`#terminal.integrated.defaultProfile.osx#`');
98113
const shellDeprecationMessageWindows = localize('terminal.integrated.shell.windows.deprecation', "This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in {0} and setting its profile name as the default in {1}. This will currently take priority over the new profiles settings but that will change in the future.", '`#terminal.integrated.profiles.windows#`', '`#terminal.integrated.defaultProfile.windows#`');
@@ -255,13 +270,7 @@ const terminalPlatformConfiguration: IConfigurationNode = {
255270
},
256271
[TerminalSettingId.ProfilesWindows]: {
257272
restricted: true,
258-
markdownDescription: localize(
259-
{
260-
key: 'terminal.integrated.profiles.windows',
261-
comment: ['{0}, {1}, and {2} are the `source`, `path` and optional `args` settings keys']
262-
},
263-
"The Windows profiles to present when creating a new terminal via the terminal dropdown. Use the {0} property to automatically detect the shell's location. Or set the {1} property manually with an optional {2}.\n\nSet an existing profile to {3} to hide the profile from the list, for example: {4}.", '`source`', '`path`', '`args`', '`null`', '`"Ubuntu-20.04 (WSL)": null`'
264-
),
273+
markdownDescription: createTerminalProfileMarkdownDescription(Platform.Windows),
265274
type: 'object',
266275
default: {
267276
'PowerShell': {
@@ -319,13 +328,7 @@ const terminalPlatformConfiguration: IConfigurationNode = {
319328
},
320329
[TerminalSettingId.ProfilesMacOs]: {
321330
restricted: true,
322-
markdownDescription: localize(
323-
{
324-
key: 'terminal.integrated.profile.osx',
325-
comment: ['{0} and {1} are the `path` and optional `args` settings keys']
326-
},
327-
"The macOS profiles to present when creating a new terminal via the terminal dropdown. Set the {0} property manually with an optional {1}.\n\nSet an existing profile to {2} to hide the profile from the list, for example: {3}.", '`path`', '`args`', '`null`', '`"bash": null`'
328-
),
331+
markdownDescription: createTerminalProfileMarkdownDescription(Platform.Mac),
329332
type: 'object',
330333
default: {
331334
'bash': {
@@ -378,13 +381,7 @@ const terminalPlatformConfiguration: IConfigurationNode = {
378381
},
379382
[TerminalSettingId.ProfilesLinux]: {
380383
restricted: true,
381-
markdownDescription: localize(
382-
{
383-
key: 'terminal.integrated.profile.linux',
384-
comment: ['{0} and {1} are the `path` and optional `args` settings keys']
385-
},
386-
"The Linux profiles to present when creating a new terminal via the terminal dropdown. Set the {0} property manually with an optional {1}.\n\nSet an existing profile to {2} to hide the profile from the list, for example: {3}.", '`path`', '`args`', '`null`', '`"bash": null`'
387-
),
384+
markdownDescription: createTerminalProfileMarkdownDescription(Platform.Linux),
388385
type: 'object',
389386
default: {
390387
'bash': {

0 commit comments

Comments
 (0)