Skip to content
Open
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
6 changes: 6 additions & 0 deletions extensions/open-remote-ssh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@
"description": "**Experimental:** The name of the server binary, use this **only if** you are using a client without a corresponding server release",
"scope": "application",
"default": ""
},
"remoteSSH.serverInstallPath": {
"type": "string",
"markdownDescription": "A custom directory to install the Positron server data on the remote machine. By default, the server data is installed in `~/.positron-server`.",
"scope": "application",
"default": ""
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion extensions/open-remote-ssh/src/serverConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export async function getVSCodeServerConfig(): Promise<IServerConfig> {
const productJson = await getVSCodeProductJson();

const customServerBinaryName = vscode.workspace.getConfiguration('remoteSSH.experimental').get<string>('serverBinaryName', '');
const customDataFolderName = vscode.workspace.getConfiguration('remoteSSH').get<string>('serverInstallPath', '');
Copy link
Contributor

@isabelizimm isabelizimm Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUPER SUPER nit, could set default here rather than later

Suggested change
const customDataFolderName = vscode.workspace.getConfiguration('remoteSSH').get<string>('serverInstallPath', '');
const serverDataFolderName = vscode.workspace.getConfiguration('remoteSSH').get<string>('serverInstallPath', productJson.serverDataFolderName);


const version = `${positron.version}-${positron.buildNumber}`;

Expand All @@ -44,7 +45,7 @@ export async function getVSCodeServerConfig(): Promise<IServerConfig> {
quality: productJson.quality,
release: productJson.release,
serverApplicationName: customServerBinaryName || productJson.serverApplicationName,
serverDataFolderName: productJson.serverDataFolderName,
serverDataFolderName: customDataFolderName || productJson.serverDataFolderName,
serverDownloadUrlTemplate: productJson.serverDownloadUrlTemplate
};
}
10 changes: 7 additions & 3 deletions extensions/open-remote-ssh/src/serverSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,15 @@ export async function installCodeServer(conn: SSHConnection, serverDownloadUrlTe

let commandOutput: { stdout: string; stderr: string };
if (platform === 'windows') {
// If the default was not changed, adjust the path for PowerShell on Windows
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support windows anyway

if (installOptions.serverDataFolderName === '$HOME/.positron-server') {
installOptions.serverDataFolderName = '$HOME\\.positron-server';
}
const installServerScript = generatePowerShellInstallScript(installOptions);

logger.trace('Server install command:', installServerScript);

const installDir = `$HOME\\${vscodeServerConfig.serverDataFolderName}\\install`;
const installDir = `${vscodeServerConfig.serverDataFolderName}\\install`;
const installScript = `${installDir}\\${vscodeServerConfig.commit}.ps1`;
const endRegex = new RegExp(`${scriptId}: end`);
// investigate if it's possible to use `-EncodedCommand` flag
Expand Down Expand Up @@ -226,7 +230,7 @@ DISTRO_VSCODIUM_RELEASE="${release ?? ''}"
SERVER_APP_NAME="${serverApplicationName}"
SERVER_INITIAL_EXTENSIONS="${extensions}"
SERVER_LISTEN_FLAG="${useSocketPath ? `--socket-path="$TMP_DIR/vscode-server-sock-${crypto.randomUUID()}"` : '--port=0'}"
SERVER_DATA_DIR="$HOME/${serverDataFolderName}"
SERVER_DATA_DIR="${serverDataFolderName}"
SERVER_DIR="$SERVER_DATA_DIR/bin/$DISTRO_COMMIT"
SERVER_SCRIPT="$SERVER_DIR/bin/$SERVER_APP_NAME"
SERVER_LOGFILE="$SERVER_DATA_DIR/.$DISTRO_COMMIT.log"
Expand Down Expand Up @@ -467,7 +471,7 @@ $DISTRO_VSCODIUM_RELEASE="${release ?? ''}"
$SERVER_APP_NAME="${serverApplicationName}"
$SERVER_INITIAL_EXTENSIONS="${extensions}"
$SERVER_LISTEN_FLAG="${useSocketPath ? `--socket-path="$TMP_DIR/vscode-server-sock-${crypto.randomUUID()}"` : '--port=0'}"
$SERVER_DATA_DIR="$(Resolve-Path ~)\\${serverDataFolderName}"
$SERVER_DATA_DIR="${serverDataFolderName}"
$SERVER_DIR="$SERVER_DATA_DIR\\bin\\$DISTRO_COMMIT"
$SERVER_SCRIPT="$SERVER_DIR\\bin\\$SERVER_APP_NAME.cmd"
$SERVER_LOGFILE="$SERVER_DATA_DIR\\.$DISTRO_COMMIT.log"
Expand Down
2 changes: 1 addition & 1 deletion product.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"serverLicense": [],
"serverLicensePrompt": "",
"serverApplicationName": "positron-server",
"serverDataFolderName": ".positron-server",
"serverDataFolderName": "$HOME/.positron-server",
"serverDownloadUrlTemplate": "https://cdn.posit.co/positron/dailies/reh/${arch-long}/positron-reh-${os}-${arch}-${version}.tar.gz",
"tunnelApplicationName": "positron-tunnel",
"win32DirName": "Positron",
Expand Down