Skip to content

Commit

Permalink
Addressed first batch of comments
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder committed Jan 17, 2023
1 parent cfabf39 commit eadd849
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
12 changes: 0 additions & 12 deletions packages/core/i18n/nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,24 +445,12 @@
"confirmCloseNever": "Never confirm.",
"enableCopy": "Enable ctrl-c (cmd-c on macOS) to copy selected text",
"enablePaste": "Enable ctrl-v (cmd-v on macOS) to paste from clipboard",
"profileNew": "New Terminal...",
"profileDefault": "Choose Default Profile...",
"selectProfile": "Select a profile for the new terminal",
"shellArgsLinux": "The command line arguments to use when on the Linux terminal.",
"shellArgsOsx": "The command line arguments to use when on the macOS terminal.",
"shellArgsWindows": "The command line arguments to use when on the Windows terminal.",
"shellLinux": "The path of the shell that the terminal uses on Linux (default: '{0}'}).",
"shellOsx": "The path of the shell that the terminal uses on macOS (default: '{0}'}).",
"shellWindows": "The path of the shell that the terminal uses on Windows. (default: '{0}').",
"shell.deprecated": "This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in 'terminal.integrated.profiles.{0}' and setting its profile name as the default in 'terminal.integrated.defaultProfile.{0}'.",
"defaultProfile": "The default profile used on {0}",
"profiles": "The profiles to present when creating a new terminal. Set the path property manually with optional args. \n\nSet an existing profile to `null` to hide the profile from the list, for example: `{0}: null`.",
"profilePath": "The path of the shell that this profile uses.",
"profileSource": "A profile source that will auto detect the paths to the shell. Note that non-standard executable locations are not supported and must be created manually in a new profile.",
"profileArgs": "The shell arguments that this profile uses.",
"profileEnv": "An object with environment variables that will be added to the terminal profile process. Set to `null` to delete environment variables from the base environment.",
"profileIcon": "A codicon ID to associate with the terminal icon. \nterminal-tmux:\"$(terminal-tmux)\"",
"profileColor": "A terminal theme color ID to associate with the terminal.",
"terminate": "Terminate",
"terminateActive": "Do you want to terminate the active terminal session?",
"terminateActiveMultiple": "Do you want to terminate the {0} active terminal sessions?"
Expand Down
11 changes: 5 additions & 6 deletions packages/terminal/src/browser/terminal-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import {
Emitter,
Event,
ViewColumn,
OS,
isWindows
OS
} from '@theia/core/lib/common';
import {
ApplicationShell, KeybindingContribution, KeyCode, Key, WidgetManager, PreferenceService,
Expand Down Expand Up @@ -258,7 +257,7 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu
this.profileService.onAdded(id => {
// extension contributions get read after this point: need to set the default profile if necessary
let defaultProfileId;
switch (OS.type()) {
switch (OS.backend.type()) {
case OS.Type.Windows: {
defaultProfileId = this.terminalPreferences['terminal.integrated.defaultProfile.windows'];
break;
Expand All @@ -277,7 +276,7 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu
}

async contributeDefaultProfiles(): Promise<void> {
if (isWindows) {
if (OS.backend.isWindows) {
this.contributedProfileStore.registerTerminalProfile('cmd', new ShellTerminalProfile(this, {
shellPath: await this.resolveShellPath([
'${env:windir}\\Sysnative\\cmd.exe',
Expand All @@ -300,7 +299,7 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu
let legacyShellPath: string | undefined;
let legacyShellArgs: string[] | undefined;
const removed = new Set(this.userProfileStore.all.map(([id, profile]) => id));
switch (OS.type()) {
switch (OS.backend.type()) {
case OS.Type.Windows: {
profiles = this.terminalPreferences['terminal.integrated.profiles.windows'];
defaultProfile = this.terminalPreferences['terminal.integrated.defaultProfile.windows'];
Expand Down Expand Up @@ -968,7 +967,7 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu
return;
}

this.preferenceService.set(`terminal.integrated.defaultProfile.${OS.type().toLowerCase()}`, result[0], PreferenceScope.User);
this.preferenceService.set(`terminal.integrated.defaultProfile.${OS.backend.type().toLowerCase()}`, result[0], PreferenceScope.User);
}

protected async openActiveWorkspaceTerminal(options?: ApplicationShell.WidgetOptions): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion packages/terminal/src/browser/terminal-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const commonProfileProperties: PreferenceSchemaProperties = {
},
icon: {
type: 'string',
markdownDescription: nls.localize('theia/terminal/profileIcon', 'A codicon ID to associate with the terminal icon. \nterminal-tmux:"$(terminal-tmux)"')
markdownDescription: nls.localize('theia/terminal/profileIcon', 'A codicon ID to associate with the terminal icon.\nterminal-tmux:"$(terminal-tmux)"')
},
color: {
type: 'string',
Expand Down
4 changes: 2 additions & 2 deletions packages/terminal/src/browser/terminal-widget-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget
const { cols, rows } = this.term;

const terminalId = await this.shellTerminalServer.create({
shell: this.options.shellPath || this.shellPreferences.shell[OS.type()],
args: this.options.shellArgs || this.shellPreferences.shellArgs[OS.type()],
shell: this.options.shellPath || this.shellPreferences.shell[OS.backend.type()],
args: this.options.shellArgs || this.shellPreferences.shellArgs[OS.backend.type()],
env: this.options.env,
strictEnv: this.options.strictEnv,
isPseudo: this.options.isPseudoTerminal,
Expand Down

0 comments on commit eadd849

Please sign in to comment.