mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Fix issue where local terminal failed to open in remote scenarios wsl (#277920)
* try adding options.remoteAuthority field for profile * try explicit remoteAuthority undefined when local * Dont touch terminalProfileResolverService.ts * Better comments to explicitly get local default profile in remote * Try to handle mac -> linux scenario * see if caching is problem * Dont mix up profile and skip list when creating local terminal in remote * Just handle wsl in this PR to make life simpler * Logs for debugging * Allow local to get backend by checking from createTerminal in terminalService.ts * leave logs to debug, code doesnt work after prev commit * stringify for better logs. isLocalRemoteTerminal value is still false * more and more logs * Bug fixed) Use Schemas.file instead of Shemas.vscodeFileResource
This commit is contained in:
@@ -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`);
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user