Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/vs/workbench/contrib/terminal/browser/terminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -975,9 +975,9 @@ export class TerminalService extends Disposable implements ITerminalService {
// Await the initialization of available profiles as long as this is not a pty terminal or a
// local terminal in a remote workspace as profile won't be used in those cases and these
// terminals need to be launched before remote connections are established.
const isLocalInRemoteTerminal = this._remoteAgentService.getConnection() && URI.isUri(options?.cwd) && options?.cwd.scheme === Schemas.file;
if (this._terminalProfileService.availableProfiles.length === 0) {
const isPtyTerminal = options?.config && hasKey(options.config, { customPtyImplementation: true });
const isLocalInRemoteTerminal = this._remoteAgentService.getConnection() && URI.isUri(options?.cwd) && options?.cwd.scheme === Schemas.vscodeFileResource;
if (!isPtyTerminal && !isLocalInRemoteTerminal) {
if (this._connectionState === TerminalConnectionState.Connecting) {
mark(`code/terminal/willGetProfiles`);
Expand All @@ -989,7 +989,18 @@ export class TerminalService extends Disposable implements ITerminalService {
}
}

const config = options?.config || this._terminalProfileService.getDefaultProfile();
let config = options?.config;
if (!config && isLocalInRemoteTerminal) {
const backend = await this._terminalInstanceService.getBackend(undefined);
const executable = await backend?.getDefaultSystemShell();
if (executable) {
config = { executable };
}
}

if (!config) {
config = this._terminalProfileService.getDefaultProfile();
}
const shellLaunchConfig = config && hasKey(config, { extensionIdentifier: true }) ? {} : this._terminalInstanceService.convertProfileToShellLaunchConfig(config || {});

// Get the contributed profile if it was provided
Expand Down
Loading