Skip to content

Commit 75ea573

Browse files
authored
revert addition of killGracefully setting (microsoft#250668)
revert addition of killGracefully setting microsoft#206607
1 parent f8e8779 commit 75ea573

File tree

4 files changed

+2
-34
lines changed

4 files changed

+2
-34
lines changed

src/vs/platform/terminal/common/terminal.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export const enum TerminalSettingId {
121121
FontLigaturesEnabled = 'terminal.integrated.fontLigatures.enabled',
122122
FontLigaturesFeatureSettings = 'terminal.integrated.fontLigatures.featureSettings',
123123
FontLigaturesFallbackLigatures = 'terminal.integrated.fontLigatures.fallbackLigatures',
124-
KillGracefully = 'terminal.integrated.killGracefully',
125124

126125
// Debug settings that are hidden from user
127126

@@ -650,10 +649,6 @@ export interface IShellLaunchConfig {
650649
* Report terminal's shell environment variables to VS Code and extensions
651650
*/
652651
shellIntegrationEnvironmentReporting?: boolean;
653-
/**
654-
* Whether the process should be killed gracefully
655-
*/
656-
killGracefully?: boolean;
657652
}
658653

659654
export interface ITerminalTabAction {

src/vs/platform/terminal/node/terminalProcess.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
377377
if (this._ptyProcess) {
378378
await this._throttleKillSpawn();
379379
this._logService.trace('node-pty.IPty#kill');
380-
if (this.shellLaunchConfig.killGracefully) {
381-
this._killGracefully(this._ptyProcess);
382-
} else {
383-
this._ptyProcess.kill();
384-
}
380+
this._ptyProcess.kill();
385381
}
386382
} catch (ex) {
387383
// Swallow, the pty has already been killed
@@ -390,10 +386,6 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
390386
this.dispose();
391387
}
392388

393-
private async _killGracefully(ptyProcess: IPty): Promise<void> {
394-
ptyProcess.kill('SIGTERM');
395-
}
396-
397389
private async _throttleKillSpawn(): Promise<void> {
398390
// Only throttle on Windows/conpty
399391
if (!isWindows || !('useConpty' in this._ptyOptions) || !this._ptyOptions.useConpty) {
@@ -460,11 +452,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
460452
setTimeout(() => {
461453
if (this._closeTimeout && !this._store.isDisposed) {
462454
this._closeTimeout = undefined;
463-
if (this._ptyProcess && this.shellLaunchConfig.killGracefully) {
464-
this._killGracefully(this._ptyProcess);
465-
} else {
466-
this._kill();
467-
}
455+
this._kill();
468456
}
469457
}, ShutdownConstants.MaximumShutdownTime);
470458
}

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
566566
if (e.affectsConfiguration(AccessibilityVerbositySettingId.Terminal)) {
567567
this._setAriaLabel(this.xterm?.raw, this._instanceId, this.title);
568568
}
569-
if (e.affectsConfiguration(TerminalSettingId.KillGracefully)) {
570-
// For windows, we already attempt to gracefully kill the process
571-
this.shellLaunchConfig.killGracefully = !isWindows && this._configurationService.getValue(TerminalSettingId.KillGracefully);
572-
}
573569
if (e.affectsConfiguration('terminal.integrated')) {
574570
this.updateConfig();
575571
this.setVisible(this._isVisible);
@@ -1510,8 +1506,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
15101506
message: nls.localize('workspaceNotTrustedCreateTerminalCwd', "Cannot launch a terminal process in an untrusted workspace with cwd {0} and userHome {1}", this._cwd, this._userHome)
15111507
});
15121508
}
1513-
// For windows, we already attempt to gracefully kill the process
1514-
this.shellLaunchConfig.killGracefully = !isWindows && this._configurationService.getValue(TerminalSettingId.KillGracefully);
15151509
// Re-evaluate dimensions if the container has been set since the xterm instance was created
15161510
if (this._container && this._cols === 0 && this._rows === 0) {
15171511
this._initDimensions();

src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,6 @@ const terminalConfiguration: IConfigurationNode = {
640640
localize('terminal.integrated.focusAfterRun.none', "Do nothing."),
641641
]
642642
},
643-
[TerminalSettingId.KillGracefully]: {
644-
type: 'boolean',
645-
default: false,
646-
markdownDescription: localize(
647-
'terminal.integrated.killGracefully',
648-
'Controls how terminal processes are terminated on macOS and Linux. When enabled, attempts a graceful shutdown of the process tree. This will send \`SIGTERM\`. When disabled (default), processes are terminated with: \`SIGHUP\` (Experimental).'
649-
),
650-
tags: ['experimental']
651-
},
652643
...terminalContribConfiguration,
653644
}
654645
};

0 commit comments

Comments
 (0)