Skip to content

Commit b1cbf5b

Browse files
fix(session): pass plot backend to attach script
The attach script for user-created R sessions now passes use_httpgd, use_jgd, and JGD_SOCKET to sess::connect(), matching the managed terminal behavior. Also fixes terminal test to handle the new SESS_PLOT_BACKEND env var and config default resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2ccef9d commit b1cbf5b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/test/suite/terminal.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ suite('R Terminal', () => {
2323
});
2424

2525
test('makeTerminalOptions sets session watcher environment variables', async () => {
26-
// Stub config to enable sessionWatcher
26+
// Stub config to enable sessionWatcher with httpgd backend
2727
const configStub = {
28-
get: (key: string) => {
28+
get: (key: string, defaultValue?: unknown) => {
2929
if (key === 'sessionWatcher') {
3030
return true;
3131
}
@@ -38,7 +38,7 @@ suite('R Terminal', () => {
3838
if (key === 'rterm.option') {
3939
return ['--no-save'];
4040
}
41-
return undefined;
41+
return defaultValue;
4242
}
4343
};
4444
sandbox.stub(util, 'config').returns(configStub as unknown as vscode.WorkspaceConfiguration);
@@ -52,6 +52,7 @@ suite('R Terminal', () => {
5252
assert.ok(options.env['SESS_PIPE']);
5353
assert.strictEqual(options.env['SESS_RSTUDIOAPI'], 'TRUE');
5454
assert.strictEqual(options.env['SESS_USE_HTTPGD'], 'TRUE');
55+
assert.strictEqual(options.env['SESS_PLOT_BACKEND'], 'httpgd');
5556
assert.ok(options.env['R_PROFILE_USER']);
5657
assert.ok(options.env['R_PROFILE_USER'].endsWith(path.join('R', 'profile.R')));
5758
});

0 commit comments

Comments
 (0)