Skip to content

Add setting to change the cwd of the Powershell Integrated Console #2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@
"default": false,
"description": "Do not show the Powershell Integrated Console banner on launch"
},
"powershell.integratedConsole.cwd": {
"type": "string",
"default": null,
"description": "An explicit start path where the Powershell Integrated Console will be launched. Predefined variables can be used (i.e. ${fileDirname} to use the current opened file's directory"
},
"powershell.debugging.createTemporaryIntegratedConsole": {
"type": "boolean",
"default": false,
Expand Down
1 change: 1 addition & 0 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class PowerShellProcess {
shellPath: this.exePath,
shellArgs: powerShellArgs,
hideFromUser: !this.sessionSettings.integratedConsole.showOnStartup,
cwd: this.sessionSettings.integratedConsole.cwd
});

const pwshName = path.basename(this.exePath);
Expand Down
2 changes: 2 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export interface IIntegratedConsoleSettings {
useLegacyReadLine?: boolean;
forceClearScrollbackBuffer?: boolean;
suppressStartupBanner?: boolean;
cwd?: string
}

export interface ISideBarSettings {
Expand Down Expand Up @@ -192,6 +193,7 @@ export function load(): ISettings {
focusConsoleOnExecute: true,
useLegacyReadLine: false,
forceClearScrollbackBuffer: false,
cwd: null
};

const defaultSideBarSettings: ISideBarSettings = {
Expand Down