Skip to content

Commit

Permalink
[gitpod] use and persist proper terminal icons
Browse files Browse the repository at this point in the history
Contains fix for upstream microsoft#124359

Fixes microsoft#4268
  • Loading branch information
JanKoehnlein committed May 21, 2021
1 parent 37f3cee commit 565bc73
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/vs/gitpod/node/remoteTerminalChannelServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class RemoteTerminalChannelServer implements IServerChannel<RemoteAgentCo
workspaceId: string,
workspaceName: string,
shouldPersistTerminal: boolean,
icon: string | undefined,
openOptions?: OpenSupervisorTerminalProcessOptions
): SupervisorTerminalProcess {
const terminalProcess = new SupervisorTerminalProcess(
Expand All @@ -145,6 +146,7 @@ export class RemoteTerminalChannelServer implements IServerChannel<RemoteAgentCo
workspaceId,
workspaceName,
shouldPersistTerminal,
icon,
this.logService,
openOptions
);
Expand Down Expand Up @@ -353,7 +355,8 @@ export class RemoteTerminalChannelServer implements IServerChannel<RemoteAgentCo
executable: shellLaunchConfigDto.executable,
args: shellLaunchConfigDto.args,
cwd: typeof shellLaunchConfigDto.cwd === 'string' ? shellLaunchConfigDto.cwd : URI.revive(shellLaunchConfigDto.cwd),
env: shellLaunchConfigDto.env
env: shellLaunchConfigDto.env,
icon: shellLaunchConfigDto.icon
};

let lastActiveWorkspace: IWorkspaceFolder | undefined;
Expand Down Expand Up @@ -440,6 +443,7 @@ export class RemoteTerminalChannelServer implements IServerChannel<RemoteAgentCo
args.workspaceId,
args.workspaceName,
args.shouldPersistTerminal,
shellLaunchConfig.icon,
{
shell: shellLaunchConfig.executable!,
shellArgs: typeof shellLaunchConfig.args === 'string' ? [shellLaunchConfig.args] : shellLaunchConfig.args || [],
Expand Down Expand Up @@ -560,7 +564,8 @@ export class RemoteTerminalChannelServer implements IServerChannel<RemoteAgentCo
terminal.getInitialWorkdir(),
workspaceId,
workspaceName,
shouldPersistTerminal
shouldPersistTerminal,
'gear'
);

terminalProcess.syncState = terminal.toObject();
Expand All @@ -583,7 +588,7 @@ export class RemoteTerminalChannelServer implements IServerChannel<RemoteAgentCo
workspaceId: terminal.workspaceId,
workspaceName: terminal.workspaceName,
isOrphan: true,
icon: 'terminal'
icon: terminal.icon
});
}
}
Expand Down
1 change: 1 addition & 0 deletions src/vs/gitpod/node/supervisorTerminalProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class SupervisorTerminalProcess extends DisposableStore implements ITermi
readonly workspaceId: string,
readonly workspaceName: string,
readonly shouldPersist: boolean,
readonly icon: string | undefined,
private readonly logService: ILogService,
private readonly openOptions?: OpenSupervisorTerminalProcessOptions
) {
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/terminal/common/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ export interface IShellLaunchConfigDto {
cwd?: string | UriComponents;
env?: ITerminalEnvironment;
hideFromUser?: boolean;
icon?: string;
}

export interface ITerminalEnvironment {
Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/api/browser/mainThreadTerminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
args: terminalInstance.shellLaunchConfig.args,
cwd: terminalInstance.shellLaunchConfig.cwd,
env: terminalInstance.shellLaunchConfig.env,
hideFromUser: terminalInstance.shellLaunchConfig.hideFromUser
hideFromUser: terminalInstance.shellLaunchConfig.hideFromUser,
icon: terminalInstance.shellLaunchConfig.icon
};
this._proxy.$acceptTerminalOpened(terminalInstance.instanceId, extHostTerminalId, terminalInstance.title, shellLaunchConfigDto);
}
Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/api/common/extHostTerminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
shellArgs: shellLaunchConfigDto.args,
cwd: typeof shellLaunchConfigDto.cwd === 'string' ? shellLaunchConfigDto.cwd : URI.revive(shellLaunchConfigDto.cwd),
env: shellLaunchConfigDto.env,
hideFromUser: shellLaunchConfigDto.hideFromUser
hideFromUser: shellLaunchConfigDto.hideFromUser,
icon: shellLaunchConfigDto.icon
};
const terminal = new ExtHostTerminal(this._proxy, id, creationOptions, name);
this._terminals.push(terminal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export class RemoteTerminalService extends Disposable implements IRemoteTerminal
executable: shellLaunchConfig.executable,
args: shellLaunchConfig.args,
cwd: shellLaunchConfig.cwd,
env: shellLaunchConfig.env
env: shellLaunchConfig.env,
icon: shellLaunchConfig.icon
};
const result = await this._remoteTerminalChannel.createProcess(
shellLaunchConfigDto,
Expand Down

0 comments on commit 565bc73

Please sign in to comment.