Revert "dont read XDG_RUNTIME_DIR"

fixes #22593

This reverts commit 867e521341.
This commit is contained in:
Joao Moreno
2017-10-30 15:13:29 +01:00
parent 044255e5e5
commit 63bfb446c4
3 changed files with 15 additions and 0 deletions
+4
View File
@@ -27,6 +27,10 @@ function getIPCHandlePath(nonce: string): string {
return `\\\\.\\pipe\\vscode-git-askpass-${nonce}-sock`; 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`); return path.join(os.tmpdir(), `vscode-git-askpass-${nonce}.sock`);
} }
+3
View File
@@ -58,6 +58,9 @@ function getUnixShellEnvironment(): TPromise<typeof process.env> {
delete env['ELECTRON_NO_ATTACH_CONSOLE']; delete env['ELECTRON_NO_ATTACH_CONSOLE'];
} }
// https://github.com/Microsoft/vscode/issues/22593#issuecomment-336050758
delete env['XDG_RUNTIME_DIR'];
c(env); c(env);
} catch (err) { } catch (err) {
e(err); e(err);
@@ -15,7 +15,15 @@ import { memoize } from 'vs/base/common/decorators';
import pkg from 'vs/platform/node/package'; import pkg from 'vs/platform/node/package';
import product from 'vs/platform/node/product'; 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 { 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`); return path.join(userDataPath, `${pkg.version}-${type}.sock`);
} }