Skip to content

Commit

Permalink
Clean up input request in case of interrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Jun 30, 2023
1 parent 35d3fa9 commit aca1af1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion extensions/jupyter-adapter/src/JupyterKernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ export class JupyterKernel extends EventEmitter implements vscode.Disposable {
* Interrupts the kernel
*/
public async interrupt(): Promise<void> {
// Clear current input request if any
this._activeInputRequestHeader = undefined;

const msg: JupyterInterruptRequest = {};
return this.send(uuidv4(), 'interrupt_request', this._control!, msg);
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-r/amalthea

0 comments on commit aca1af1

Please sign in to comment.