Skip to content

Commit 9a42b72

Browse files
authored
Merge pull request #217 from rstudio/issue-213
Skip serializing our internal language kernel terminal processes on shutdown
2 parents 482c505 + 5615eed commit 9a42b72

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@
549549
"Attach to Main Process",
550550
"Attach to Extension Host",
551551
"Attach to Shared Process",
552+
"Attach to Pty Host Process"
552553
],
553554
"preLaunchTask": "Ensure Prelaunch Dependencies",
554555
"presentation": {

extensions/jupyter-adapter/src/JupyterKernel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ export class JupyterKernel extends EventEmitter implements vscode.Disposable {
409409
const command = args.join(' ');
410410

411411
// Create environment.
412-
const env = {};
412+
const env = { POSITRON_VERSION: positron.version };
413413
Object.assign(env, process.env, this._spec.env);
414414

415415
// We are now starting the kernel

src/vs/platform/terminal/node/ptyService.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ export class PtyService extends Disposable implements IPtyService {
134134
async serializeTerminalState(ids: number[]): Promise<string> {
135135
const promises: Promise<ISerializedTerminalState>[] = [];
136136
for (const [persistentProcessId, persistentProcess] of this._ptys.entries()) {
137+
138+
// --- Start Positron ---
139+
// Skip serializing Positron language runtime kernel processes
140+
const positronLanguage = persistentProcess.shellLaunchConfig.env?.POSITRON_VERSION;
141+
if (positronLanguage) {
142+
continue;
143+
}
144+
// --- End Positron ---
145+
137146
// Only serialize persistent processes that have had data written or performed a replay
138147
if (persistentProcess.hasWrittenData && ids.indexOf(persistentProcessId) !== -1) {
139148
promises.push(Promises.withAsyncBody<ISerializedTerminalState>(async r => {

0 commit comments

Comments
 (0)