|
5 | 5 |
|
6 | 6 | import { getAllCodicons } from 'vs/base/common/codicons';
|
7 | 7 | 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'; |
9 | 9 | import { localize } from 'vs/nls';
|
10 | 10 | import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
11 | 11 | import { Registry } from 'vs/platform/registry/common/platform';
|
@@ -93,6 +93,21 @@ const terminalAutomationProfileSchema: IJSONSchema = {
|
93 | 93 | }
|
94 | 94 | };
|
95 | 95 |
|
| 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 | + |
96 | 111 | 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#`');
|
97 | 112 | 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#`');
|
98 | 113 | 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 = {
|
255 | 270 | },
|
256 | 271 | [TerminalSettingId.ProfilesWindows]: {
|
257 | 272 | 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), |
265 | 274 | type: 'object',
|
266 | 275 | default: {
|
267 | 276 | 'PowerShell': {
|
@@ -319,13 +328,7 @@ const terminalPlatformConfiguration: IConfigurationNode = {
|
319 | 328 | },
|
320 | 329 | [TerminalSettingId.ProfilesMacOs]: {
|
321 | 330 | 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), |
329 | 332 | type: 'object',
|
330 | 333 | default: {
|
331 | 334 | 'bash': {
|
@@ -378,13 +381,7 @@ const terminalPlatformConfiguration: IConfigurationNode = {
|
378 | 381 | },
|
379 | 382 | [TerminalSettingId.ProfilesLinux]: {
|
380 | 383 | 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), |
388 | 385 | type: 'object',
|
389 | 386 | default: {
|
390 | 387 | 'bash': {
|
|
0 commit comments