Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/9935.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switching kernels should disable the run/interrupt/restart buttons.
7 changes: 6 additions & 1 deletion src/client/datascience/interactive-common/interactiveBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,12 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp
if (!this._notebook) {
return;
}
await this.commandManager.executeCommand(Commands.SwitchJupyterKernel, this._notebook);
try {
this.startProgress();
await this.commandManager.executeCommand(Commands.SwitchJupyterKernel, this._notebook);
} finally {
this.stopProgress();
}
}
private async kernelChangeHandler(kernel: IJupyterKernelSpec | LiveKernelModel) {
// Check if we are changing to LiveKernelModel
Expand Down
2 changes: 2 additions & 0 deletions src/datascience-ui/native-editor/nativeCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface INativeCellBaseProps {
editorOptions: monacoEditor.editor.IEditorOptions;
themeMatplotlibPlots: boolean | undefined;
focusPending: number;
busy: boolean;
}

type INativeCellProps = INativeCellBaseProps & typeof actionCreators;
Expand Down Expand Up @@ -567,6 +568,7 @@ export class NativeCell extends React.Component<INativeCellProps> {
onClick={runCell}
tooltip={getLocString('DataScience.runCell', 'Run cell')}
hidden={this.isMarkdownCell()}
disabled={this.props.busy}
>
<Image baseTheme={this.props.baseTheme} class="image-button-image" image={ImageName.Run} />
</ImageButton>
Expand Down
1 change: 1 addition & 0 deletions src/datascience-ui/native-editor/nativeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ ${buildSettingsCss(this.props.settings)}`}</style>
themeMatplotlibPlots={this.props.settings.themeMatplotlibPlots}
// Focus pending does not apply to native editor.
focusPending={0}
busy={this.props.busy}
/>
</ErrorBoundary>
{lastLine}
Expand Down