Skip to content

Commit

Permalink
Revert "dont read XDG_RUNTIME_DIR"
Browse files Browse the repository at this point in the history
fixes #22593

This reverts commit 867e521.
  • Loading branch information
joaomoreno authored and egamma committed Oct 31, 2017
1 parent d489818 commit fe6f973
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extensions/git/src/askpass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ function getIPCHandlePath(nonce: string): string {
return `\\\\.\\pipe\\vscode-git-askpass-${nonce}-sock`;
}

if (process.env['XDG_RUNTIME_DIR']) {
return path.join(process.env['XDG_RUNTIME_DIR'], `vscode-git-askpass-${nonce}.sock`);
}

return path.join(os.tmpdir(), `vscode-git-askpass-${nonce}.sock`);
}

Expand Down
3 changes: 3 additions & 0 deletions src/vs/code/node/shellEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ function getUnixShellEnvironment(): TPromise<typeof process.env> {
delete env['ELECTRON_NO_ATTACH_CONSOLE'];
}

// https://github.com/Microsoft/vscode/issues/22593#issuecomment-336050758
delete env['XDG_RUNTIME_DIR'];

c(env);
} catch (err) {
e(err);
Expand Down
8 changes: 8 additions & 0 deletions src/vs/platform/environment/node/environmentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ import { memoize } from 'vs/base/common/decorators';
import pkg from 'vs/platform/node/package';
import product from 'vs/platform/node/product';

// Read this before there's any chance it is overwritten
// Related to https://github.com/Microsoft/vscode/issues/30624
const xdgRuntimeDir = process.env['XDG_RUNTIME_DIR'];

function getNixIPCHandle(userDataPath: string, type: string): string {
if (xdgRuntimeDir) {
return path.join(xdgRuntimeDir, `${pkg.name}-${pkg.version}-${type}.sock`);
}

return path.join(userDataPath, `${pkg.version}-${type}.sock`);
}

Expand Down

0 comments on commit fe6f973

Please sign in to comment.