Merge pull request #126301 from microsoft/tyriar/118276
Support detaching terminal processes manually
This commit is contained in:
commit
8fdf47ad6d
4 changed files with 17 additions and 1 deletions
|
@ -846,6 +846,19 @@ export function registerTerminalActions() {
|
|||
accessor.get(ITerminalService).hideFindWidget();
|
||||
}
|
||||
});
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: TerminalCommandId.DetachProcess,
|
||||
title: { value: localize('workbench.action.terminal.detachProcess', "Detach Process"), original: 'Detach Process' },
|
||||
f1: true,
|
||||
category
|
||||
});
|
||||
}
|
||||
async run(accessor: ServicesAccessor) {
|
||||
accessor.get(ITerminalService).doWithActiveInstance(instance => instance.detachFromProcess());
|
||||
}
|
||||
});
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
|
|
|
@ -984,6 +984,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
|
||||
detachFromProcess(): void {
|
||||
this._processManager.detachFromProcess();
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
forceRedraw(): void {
|
||||
|
|
|
@ -176,6 +176,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
|||
|
||||
detachFromProcess(): void {
|
||||
this._process?.detach?.();
|
||||
this._process = null;
|
||||
}
|
||||
|
||||
async createProcess(
|
||||
|
|
|
@ -447,7 +447,8 @@ export const enum TerminalCommandId {
|
|||
NavigationModeFocusPrevious = 'workbench.action.terminal.navigationModeFocusPrevious',
|
||||
ShowEnvironmentInformation = 'workbench.action.terminal.showEnvironmentInformation',
|
||||
SearchWorkspace = 'workbench.action.terminal.searchWorkspace',
|
||||
AttachToRemoteTerminal = 'workbench.action.terminal.attachToSession'
|
||||
AttachToRemoteTerminal = 'workbench.action.terminal.attachToSession',
|
||||
DetachProcess = 'workbench.action.terminal.detachProcess'
|
||||
}
|
||||
|
||||
export const DEFAULT_COMMANDS_TO_SKIP_SHELL: string[] = [
|
||||
|
|
Loading…
Reference in a new issue