-
Notifications
You must be signed in to change notification settings - Fork 510
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will set the process CWD, but I don't think it will set the integrated console location on start, which I believe is currently the workspace root. I may be wrong about this though.
Today, the two can be managed separately from the integrated console with Set-Location
and [System.Environment]::CurrentDirectory = ...
. So I think the value would be in customising the startup location for both -- otherwise I imagine we will get error reports about the CWD setting not setting the integrated console's startup location. For this we would need changes in PSES though.
@jwfx when you open vscode, do you have a folder opened or does it say: |
I have no folder open. As soon as I have an open folder, the folder path takes precedence and the Integrated Console is launched in that opened folder, no matter where the .ps1 is located I'm trying to open. Maybe that behavior could be mentioned in the setting description? |
I think we would want to change the behaviour to make |
The integrated console's location is set here. Changing the behaviour needs to pull the setting from the configuration service and if it's not-null, use that |
It seems like open workspace folders seem to override the location that is passed into createTerminal(). The process cwd is still applied though. I've changed the PR so that it is at least consistent for now. The I'd be thankful for pointers how to make the cwd setting also work for open workspace folders. I'm not sure if this even in the scope of this extension? Just guessing here.. I am new to this. **edit Thanks, you are faster than me ;) |
Ok, I think I got it. I couldn't make the required changes here, because the configuration values are not available at this point. Should I turn this into a PR on the PSES repo? |
@jwfx you need changes in both to make this all come together. This makes sense because vscode-powershell and PSES work together. |
Not sure if I can do anything about those failed checks..? |
They're bugs in PowerShell, being addressed there. Hopefully we can merge that soon and get the checks passing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
PR Summary
This adds a new setting that will allow users to set the current working directory for the Powershell Integrated Console
Resolves #2227
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.NA
PR has tests