task reconnection polish (#158774)

fix #158770 && fix #158676
This commit is contained in:
Megan Rogge 2022-08-22 09:05:23 -07:00 committed by GitHub
parent 650669abff
commit 8515f91a56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -1302,7 +1302,7 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
reconnectedTerminal.waitOnExit = getWaitOnExitValue(task.command.presentation, task.configurationProperties); reconnectedTerminal.waitOnExit = getWaitOnExitValue(task.command.presentation, task.configurationProperties);
} }
reconnectedTerminal.onDisposed((terminal) => this._fireTaskEvent({ kind: TaskEventKind.Terminated, exitReason: terminal.exitReason, taskId: task.getRecentlyUsedKey() })); reconnectedTerminal.onDisposed((terminal) => this._fireTaskEvent({ kind: TaskEventKind.Terminated, exitReason: terminal.exitReason, taskId: task.getRecentlyUsedKey() }));
this._logService.info('reconnected to task and terminal', task._id); this._logService.trace('reconnected to task and terminal', task._id);
return reconnectedTerminal; return reconnectedTerminal;
} }
if (group) { if (group) {
@ -1330,20 +1330,20 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
private _reconnectToTerminals(): void { private _reconnectToTerminals(): void {
if (this._hasReconnected) { if (this._hasReconnected) {
this._logService.info(`Already reconnected, to ${this._reconnectedTerminals?.length} terminals so returning`); this._logService.trace(`Already reconnected, to ${this._reconnectedTerminals?.length} terminals so returning`);
return; return;
} }
this._reconnectedTerminals = this._terminalService.getReconnectedTerminals(ReconnectionType)?.filter(t => !t.isDisposed); this._reconnectedTerminals = this._terminalService.getReconnectedTerminals(ReconnectionType)?.filter(t => !t.isDisposed);
this._logService.info(`Attempting reconnection of ${this._reconnectedTerminals?.length} terminals`); this._logService.trace(`Attempting reconnection of ${this._reconnectedTerminals?.length} terminals`);
if (!this._reconnectedTerminals?.length) { if (!this._reconnectedTerminals?.length) {
this._logService.info(`No terminals to reconnect to so returning`); this._logService.trace(`No terminals to reconnect to so returning`);
this._hasReconnected = true; this._hasReconnected = true;
return; return;
} else { } else {
for (const terminal of this._reconnectedTerminals) { for (const terminal of this._reconnectedTerminals) {
const task = terminal.shellLaunchConfig.attachPersistentProcess?.reconnectionProperties?.data as IReconnectionTaskData; const task = terminal.shellLaunchConfig.attachPersistentProcess?.reconnectionProperties?.data as IReconnectionTaskData;
if (this._logService.getLevel() <= LogLevel.Trace) { if (this._logService.getLevel() <= LogLevel.Trace) {
this._logService.info(`Reconnecting to task: ${JSON.stringify(task)}`); this._logService.trace(`Reconnecting to task: ${JSON.stringify(task)}`);
} }
if (!task) { if (!task) {
continue; continue;

View file

@ -1205,7 +1205,7 @@ export const enum TaskSettingId {
QuickOpenSkip = 'task.quickOpen.skip', QuickOpenSkip = 'task.quickOpen.skip',
QuickOpenShowAll = 'task.quickOpen.showAll', QuickOpenShowAll = 'task.quickOpen.showAll',
AllowAutomaticTasks = 'task.allowAutomaticTasks', AllowAutomaticTasks = 'task.allowAutomaticTasks',
Reconnection = 'task.experimental.reconnection' Reconnection = 'task.reconnection'
} }
export const enum TasksSchemaProperties { export const enum TasksSchemaProperties {