mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Merge pull request #159670 from microsoft/tyriar/157611_2
Fix terminal opening when multiple users are connected via remote-ssh
This commit is contained in:
commit
47e556e91b
|
@ -184,7 +184,7 @@ export function getShellIntegrationInjection(
|
|||
newArgs = [...newArgs]; // Shallow clone the array to avoid setting the default array
|
||||
newArgs[newArgs.length - 1] = format(newArgs[newArgs.length - 1], appRoot);
|
||||
// Move .zshrc into $ZDOTDIR as the way to activate the script
|
||||
const zdotdir = path.join(os.tmpdir(), 'vscode-zsh');
|
||||
const zdotdir = path.join(os.tmpdir(), `${os.userInfo().username}-vscode-zsh`);
|
||||
envMixin['ZDOTDIR'] = zdotdir;
|
||||
const filesToCopy: IShellIntegrationConfigInjection['filesToCopy'] = [];
|
||||
filesToCopy.push({
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { deepStrictEqual, ok, strictEqual } from 'assert';
|
||||
import { userInfo } from 'os';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal';
|
||||
import { getShellIntegrationInjection, IShellIntegrationConfigInjection } from 'vs/platform/terminal/node/terminalEnvironment';
|
||||
|
@ -94,8 +95,14 @@ suite('platform - terminalEnvironment', () => {
|
|||
if (process.platform !== 'win32') {
|
||||
suite('zsh', () => {
|
||||
suite('should override args', () => {
|
||||
const expectedDir = /.+\/vscode-zsh/;
|
||||
const expectedDests = [/.+\/vscode-zsh\/.zshrc/, /.+\/vscode-zsh\/.zprofile/, /.+\/vscode-zsh\/.zshenv/, /.+\/vscode-zsh\/.zlogin/];
|
||||
const username = userInfo().username;
|
||||
const expectedDir = new RegExp(`.+\/${username}-vscode-zsh`);
|
||||
const expectedDests = [
|
||||
new RegExp(`.+\/${username}-vscode-zsh\/\.zshrc`),
|
||||
new RegExp(`.+\/${username}-vscode-zsh\/\.zprofile`),
|
||||
new RegExp(`.+\/${username}-vscode-zsh\/\.zshenv`),
|
||||
new RegExp(`.+\/${username}-vscode-zsh\/\.zlogin`)
|
||||
];
|
||||
const expectedSources = [
|
||||
/.+\/out\/vs\/workbench\/contrib\/terminal\/browser\/media\/shellIntegration-rc.zsh/,
|
||||
/.+\/out\/vs\/workbench\/contrib\/terminal\/browser\/media\/shellIntegration-profile.zsh/,
|
||||
|
|
Loading…
Reference in a new issue