From aca1af15fd6ae16281c18ae8502939b4878162cd Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Fri, 30 Jun 2023 11:27:06 +0200 Subject: [PATCH] Clean up input request in case of interrupt --- extensions/jupyter-adapter/src/JupyterKernel.ts | 5 ++++- extensions/positron-r/amalthea | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/jupyter-adapter/src/JupyterKernel.ts b/extensions/jupyter-adapter/src/JupyterKernel.ts index 77fd3a9eab92..b6fe2920185c 100644 --- a/extensions/jupyter-adapter/src/JupyterKernel.ts +++ b/extensions/jupyter-adapter/src/JupyterKernel.ts @@ -696,6 +696,9 @@ export class JupyterKernel extends EventEmitter implements vscode.Disposable { * Interrupts the kernel */ public async interrupt(): Promise { + // Clear current input request if any + this._activeInputRequestHeader = undefined; + const msg: JupyterInterruptRequest = {}; return this.send(uuidv4(), 'interrupt_request', this._control!, msg); } @@ -810,7 +813,7 @@ export class JupyterKernel extends EventEmitter implements vscode.Disposable { this.log(`Sending input reply for ${id}: ${value}`); this.sendToSocket(uuidv4(), 'input_reply', this._stdin!, parent, msg); - // Remove the request from the map now that we've replied + // Remove the active input request now that we've replied this._activeInputRequestHeader = undefined; } else { // Couldn't find the request? Send the response anyway; most likely diff --git a/extensions/positron-r/amalthea b/extensions/positron-r/amalthea index e12608b7c48a..0a2117aebcb7 160000 --- a/extensions/positron-r/amalthea +++ b/extensions/positron-r/amalthea @@ -1 +1 @@ -Subproject commit e12608b7c48ab2298ea2d869499e491c0964d581 +Subproject commit 0a2117aebcb797f6dbc7205b8d0c617f6b83bd8f