Add the interaction mode to the console to catch commands

pull/7790/head
Nicolas Brichet 3 months ago
parent a156fd8347
commit c1fac6d646

@ -46,6 +46,7 @@
"@jupyterlab/coreutils": "~6.6.0-alpha.0",
"@jupyterlab/notebook": "~4.6.0-alpha.0",
"@jupyterlab/rendermime": "~4.6.0-alpha.0",
"@jupyterlab/settingregistry": "~4.6.0-alpha.0",
"@jupyterlab/translation": "~4.6.0-alpha.0",
"@jupyterlab/ui-components": "~4.6.0-alpha.0",
"@lumino/algorithm": "^2.0.4",

@ -25,6 +25,8 @@ import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
import { ITranslator, nullTranslator } from '@jupyterlab/translation';
import { ISettingRegistry } from '@jupyterlab/settingregistry';
import { consoleIcon } from '@jupyterlab/ui-components';
import {
@ -123,7 +125,7 @@ const scratchPadConsole: JupyterFrontEndPlugin<void> = {
IRenderMimeRegistry,
INotebookTracker,
],
optional: [INotebookShell, ICommandPalette, ITranslator],
optional: [INotebookShell, ICommandPalette, ITranslator, ISettingRegistry],
autoStart: true,
description: 'Open consoles in a new tab',
activate: (
@ -135,7 +137,8 @@ const scratchPadConsole: JupyterFrontEndPlugin<void> = {
tracker: INotebookTracker,
notebookShell: INotebookShell | null,
palette: ICommandPalette | null,
translator: ITranslator | null
translator: ITranslator | null,
settingRegistry: ISettingRegistry | null
) => {
const { commands } = app;
const manager = app.serviceManager;
@ -191,6 +194,15 @@ const scratchPadConsole: JupyterFrontEndPlugin<void> = {
panel.title.caption = trans.__('Console');
panel.id = consoleId;
const interactionMode: string = ((
await settingRegistry?.get(
'@jupyterlab/console-extension:tracker',
'interactionMode'
)
)?.composite ?? 'notebook') as string;
(panel as ConsolePanel).console.node.dataset.jpInteractionMode =
interactionMode;
notebookShell.add(panel, 'right');
}

@ -2389,6 +2389,7 @@ __metadata:
"@jupyterlab/coreutils": ~6.6.0-alpha.0
"@jupyterlab/notebook": ~4.6.0-alpha.0
"@jupyterlab/rendermime": ~4.6.0-alpha.0
"@jupyterlab/settingregistry": ~4.6.0-alpha.0
"@jupyterlab/translation": ~4.6.0-alpha.0
"@jupyterlab/ui-components": ~4.6.0-alpha.0
"@lumino/algorithm": ^2.0.4

Loading…
Cancel
Save