Skip to content

Commit 3a6c041

Browse files
committed
Add debug logs for reattaching to wrong terminal
Part of microsoft#133542
1 parent cf30025 commit 3a6c041

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ export class PtyService extends Disposable implements IPtyService {
240240
);
241241
// Don't start the process here as there's no terminal to answer CPR
242242
this._revivedPtyIdMap.set(terminal.id, { newId, state: terminal });
243+
this._logService.info(`Revived process, old id ${terminal.id} -> new id ${newId}`);
243244
}
244245

245246
@traceRpc
@@ -532,6 +533,7 @@ export class PtyService extends Disposable implements IPtyService {
532533
private async _expandTerminalInstance(t: ITerminalInstanceLayoutInfoById): Promise<IRawTerminalInstanceLayoutInfo<IProcessDetails | null>> {
533534
try {
534535
const revivedPtyId = this._revivedPtyIdMap.get(t.terminal)?.newId;
536+
this._logService.info(`Expanding terminal instance, old id ${t.terminal} -> new id ${revivedPtyId}`);
535537
this._revivedPtyIdMap.delete(t.terminal);
536538
const persistentProcessId = revivedPtyId ?? t.terminal;
537539
const persistentProcess = this._throwIfNoPty(persistentProcessId);
@@ -542,6 +544,8 @@ export class PtyService extends Disposable implements IPtyService {
542544
};
543545
} catch (e) {
544546
this._logService.warn(`Couldn't get layout info, a terminal was probably disconnected`, e.message);
547+
this._logService.info('Reattach to wrong terminal debug info - layout info by id', t);
548+
this._logService.info('Reattach to wrong terminal debug info - _revivePtyIdMap', Array.from(this._revivedPtyIdMap.values()));
545549
// this will be filtered out and not reconnected
546550
return {
547551
terminal: null,

0 commit comments

Comments
 (0)