From 5b29aef5f3424e49956dfa2a67a9669608d01f4c Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Fri, 25 Oct 2019 10:52:18 -0700 Subject: [PATCH] fix stdin cancel breaks notebook (#8012) --- src/sql/workbench/parts/notebook/browser/models/cell.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sql/workbench/parts/notebook/browser/models/cell.ts b/src/sql/workbench/parts/notebook/browser/models/cell.ts index ca185bd0ba..c52e41fe80 100644 --- a/src/sql/workbench/parts/notebook/browser/models/cell.ts +++ b/src/sql/workbench/parts/notebook/browser/models/cell.ts @@ -311,6 +311,10 @@ export class CellModel implements ICellModel { // If cell is currently running and user clicks the stop/cancel button, call kernel.interrupt() // This matches the same behavior as JupyterLab if (this.future && this.future.inProgress) { + // If stdIn is visible, to prevent a kernel hang, we need to send a dummy input reply + if (this._stdInVisible && this._stdInHandler) { + this.future.sendInputReply({ value: '' }); + } this.future.inProgress = false; await kernel.interrupt(); this.sendNotification(notificationService, Severity.Info, localize('runCellCancelled', "Cell execution cancelled"));