diff --git a/src/kernels/raw/session/rawKernelConnection.node.ts b/src/kernels/raw/session/rawKernelConnection.node.ts index 386523f7637..508593a35ca 100644 --- a/src/kernels/raw/session/rawKernelConnection.node.ts +++ b/src/kernels/raw/session/rawKernelConnection.node.ts @@ -357,16 +357,16 @@ export class RawKernelConnection implements Kernel.IKernelConnection { if (this.kernelProcess?.canInterrupt) { return this.kernelProcess?.interrupt(); } else if (this.kernelConnectionMetadata.kernelSpec.interrupt_mode === 'message') { - logger.info(`Interrupting kernel with a shell message`); + logger.info(`Interrupting kernel with a control message`); const jupyterLab = require('@jupyterlab/services') as typeof import('@jupyterlab/services'); const msg = jupyterLab.KernelMessage.createMessage({ msgType: 'interrupt_request' as any, - channel: 'shell', + channel: 'control', username: this.realKernel!.username, session: this.realKernel!.clientId, content: {} - }) as any as KernelMessage.IShellMessage<'inspect_request'>; - await this.realKernel!.sendShellMessage<'interrupt_request'>(msg as any, true, true).done.catch((ex) => + }) as any as KernelMessage.IControlMessage<'interrupt_request'>; + await this.realKernel!.sendControlMessage<'interrupt_request'>(msg as any, true, true).done.catch((ex) => logger.error('Failed to interrupt via a message', ex) ); } else { diff --git a/src/kernels/raw/session/rawSessionConnection.node.unit.test.ts b/src/kernels/raw/session/rawSessionConnection.node.unit.test.ts index 9b257143a18..4c3985b6395 100644 --- a/src/kernels/raw/session/rawSessionConnection.node.unit.test.ts +++ b/src/kernels/raw/session/rawSessionConnection.node.unit.test.ts @@ -505,8 +505,8 @@ suite('Raw Session & Raw Kernel Connection', () => { test('Send and interrupt message', async () => { (kernelConnectionMetadata.kernelSpec as ReadWrite).interrupt_mode = 'message'; when(kernelProcess.canInterrupt).thenReturn(false); - let request: KernelMessage.IShellMessage | undefined; - when(kernel.sendShellMessage(anything(), anything(), anything())).thenCall((msg) => { + let request: KernelMessage.IControlMessage | undefined; + when(kernel.sendControlMessage(anything(), anything(), anything())).thenCall((msg) => { request = msg; return { done: Promise.resolve() } as any; }); @@ -514,7 +514,7 @@ suite('Raw Session & Raw Kernel Connection', () => { await session.kernel?.interrupt(); verify(kernelProcess.interrupt()).never(); - verify(kernel.sendShellMessage(anything(), anything(), anything())).once(); + verify(kernel.sendControlMessage(anything(), anything(), anything())).once(); assert.strictEqual(request?.header.msg_type, 'interrupt_request'); }); });