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
7 changes: 6 additions & 1 deletion src/authResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { untildify, exists as fileExists } from './common/files';
import { findRandomPort } from './common/ports';
import { disposeAll } from './common/disposable';
import { installCodeServer, ServerInstallError } from './serverSetup';
import { isWindows } from './common/platform';
import { isWindows, isFlatpak } from './common/platform';
import * as os from 'os';

const PASSWORD_RETRY_COUNT = 3;
Expand Down Expand Up @@ -163,6 +163,11 @@ export class RemoteSSHResolver implements vscode.RemoteAuthorityResolver, vscode
options = { shell: true, windowsHide: true, windowsVerbatimArguments: true };
}

if (isFlatpak) {
proxyArgs = ["--", "flatpak-spawn", "--host", "--env=TERM=xterm-256", proxyCommand, ...proxyArgs];
Copy link
Author

Choose a reason for hiding this comment

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

Let me know if you would lime to use the TERM envvar defined locally if existing instead of forcing this xterm setup

proxyCommand = "/usr/bin/env";
}

this.logger.trace(`Spawning ProxyCommand: ${proxyCommand} ${proxyArgs.join(' ')}`);

const child = cp.spawn(proxyCommand, proxyArgs, options);
Expand Down
1 change: 1 addition & 0 deletions src/common/platform.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const isWindows = process.platform === 'win32';
export const isMacintosh = process.platform === 'darwin';
export const isLinux = process.platform === 'linux';
export const isFlatpak = !!process.env['FLATPAK_ID'];
Copy link
Author

Choose a reason for hiding this comment

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

There seems to be other envvar that could be used, let me know if you would like me to consolidate that