Skip to content

Commit 415cab4

Browse files
committed
Do not override kernels info in other notebooks (#9958)
For #9951, #9950, #9949 * Do not override kernels info in other notebooks * Fixes
1 parent ed09569 commit 415cab4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/client/datascience/jupyter/liveshare/hostJupyterServer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,16 @@ export class HostJupyterServer extends LiveShareParticipantHost(JupyterServerBas
158158
// Otherwise create a new notebook.
159159

160160
// First we need our launch information so we can start a new session (that's what our notebook is really)
161-
const launchInfo = await this.waitForConnect();
161+
let launchInfo = await this.waitForConnect();
162162
if (!launchInfo) {
163163
throw this.getDisposedError();
164164
}
165+
// Create a copy of launch info, cuz we're modifying it here.
166+
// This launch info contains the server connection info (that could be shared across other nbs).
167+
// However the kernel info is different. The kernel info is stored as a property of this, hence create a separate instance for each nb.
168+
launchInfo = {
169+
...launchInfo
170+
};
165171

166172
// Find a kernel that can be used.
167173
// Do this only if kernel information has been provided in the metadata, else use the default.

0 commit comments

Comments
 (0)