Skip to content

Commit

Permalink
Remote shell type support
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Mar 6, 2021
1 parent c40b367 commit 61ea6ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/vs/workbench/contrib/terminal/browser/remotePty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
public get onProcessReady(): Event<{ pid: number, cwd: string }> { return this._onProcessReady.event; }
private readonly _onProcessTitleChanged = this._register(new Emitter<string>());
public readonly onProcessTitleChanged: Event<string> = this._onProcessTitleChanged.event;
private readonly _onProcessShellTypeChanged = this._register(new Emitter<TerminalShellType | undefined>());
public readonly onProcessShellTypeChanged = this._onProcessShellTypeChanged.event;
private readonly _onProcessOverrideDimensions = this._register(new Emitter<ITerminalDimensionsOverride | undefined>());
public readonly onProcessOverrideDimensions: Event<ITerminalDimensionsOverride | undefined> = this._onProcessOverrideDimensions.event;
private readonly _onProcessResolvedShellLaunchConfig = this._register(new Emitter<IShellLaunchConfig>());
public get onProcessResolvedShellLaunchConfig(): Event<IShellLaunchConfig> { return this._onProcessResolvedShellLaunchConfig.event; }
// TODO: This never gets fired
private readonly _onProcessShellTypeChanged = this._register(new Emitter<TerminalShellType | undefined>());
public readonly onProcessShellTypeChanged = this._onProcessShellTypeChanged.event;

private _startBarrier: Barrier;

Expand Down Expand Up @@ -170,6 +169,9 @@ export class RemotePty extends Disposable implements ITerminalChildProcess {
handleTitleChanged(e: string) {
this._onProcessTitleChanged.fire(e);
}
handleShellTypeChanged(e: TerminalShellType | undefined) {
this._onProcessShellTypeChanged.fire(e);
}
handleOverrideDimensions(e: ITerminalDimensionsOverride | undefined) {
this._onProcessOverrideDimensions.fire(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class RemoteTerminalService extends Disposable implements IRemoteTerminal
});
channel.onProcessReady(e => this._ptys.get(e.id)?.handleReady(e.event));
channel.onProcessTitleChanged(e => this._ptys.get(e.id)?.handleTitleChanged(e.event));
channel.onProcessShellTypeChanged(e => this._ptys.get(e.id)?.handleShellTypeChanged(e.event));
channel.onProcessOverrideDimensions(e => this._ptys.get(e.id)?.handleOverrideDimensions(e.event));
channel.onProcessResolvedShellLaunchConfig(e => this._ptys.get(e.id)?.handleResolvedShellLaunchConfig(e.event));
channel.onProcessReplay(e => this._ptys.get(e.id)?.handleReplay(e.event));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { Schemas } from 'vs/base/common/network';
import { ILabelService } from 'vs/platform/label/common/label';
import { IEnvironmentVariableService, ISerializableEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
import { IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalEnvironment, ITerminalLaunchError, ITerminalsLayoutInfo, ITerminalsLayoutInfoById } from 'vs/platform/terminal/common/terminal';
import { IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalEnvironment, ITerminalLaunchError, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalShellType } from 'vs/platform/terminal/common/terminal';
import { ITerminalConfiguration, TERMINAL_CONFIG_SECTION } from 'vs/workbench/contrib/terminal/common/terminal';
import { IGetTerminalLayoutInfoArgs, IProcessDetails, IPtyHostProcessReplayEvent, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';

Expand Down Expand Up @@ -116,6 +116,9 @@ export class RemoteTerminalChannelClient {
public get onProcessTitleChanged(): Event<{ id: number, event: string }> {
return this._channel.listen<{ id: number, event: string }>('$onProcessTitleChangedEvent');
}
public get onProcessShellTypeChanged(): Event<{ id: number, event: TerminalShellType | undefined }> {
return this._channel.listen<{ id: number, event: TerminalShellType | undefined }>('$onProcessShellTypeChangedEvent');
}
public get onProcessOverrideDimensions(): Event<{ id: number, event: ITerminalDimensionsOverride | undefined }> {
return this._channel.listen<{ id: number, event: ITerminalDimensionsOverride | undefined }>('$onProcessOverrideDimensionsEvent');
}
Expand Down

0 comments on commit 61ea6ad

Please sign in to comment.