Skip to content

Commit 1cffaaa

Browse files
committed
feat: add support for Flatpak
1 parent 496c1dc commit 1cffaaa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/authResolver.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { untildify, exists as fileExists } from './common/files';
1515
import { findRandomPort } from './common/ports';
1616
import { disposeAll } from './common/disposable';
1717
import { installCodeServer, ServerInstallError } from './serverSetup';
18-
import { isWindows } from './common/platform';
18+
import { isWindows, isFlatpak } from './common/platform';
1919
import * as os from 'os';
2020

2121
const PASSWORD_RETRY_COUNT = 3;
@@ -163,6 +163,11 @@ export class RemoteSSHResolver implements vscode.RemoteAuthorityResolver, vscode
163163
options = { shell: true, windowsHide: true, windowsVerbatimArguments: true };
164164
}
165165

166+
if (isFlatpak) {
167+
proxyArgs = ["--", "flatpak-spawn", "--host", "--env=TERM=xterm-256", proxyCommand, ...proxyArgs];
168+
proxyCommand = "/usr/bin/env";
169+
}
170+
166171
this.logger.trace(`Spawning ProxyCommand: ${proxyCommand} ${proxyArgs.join(' ')}`);
167172

168173
const child = cp.spawn(proxyCommand, proxyArgs, options);

src/common/platform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const isWindows = process.platform === 'win32';
22
export const isMacintosh = process.platform === 'darwin';
33
export const isLinux = process.platform === 'linux';
4+
export const isFlatpak = !!process.env['FLATPAK_ID'];

0 commit comments

Comments
 (0)