-
Notifications
You must be signed in to change notification settings - Fork 237
Set current directory to workspace path when EditorSession is created #237
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
Comments
That would be a good default. But could we also have a settings.json entry if we want to point to another folder ? |
Great idea! What should the setting be called for that? Ideas:
|
InitialWorkingDirectory sounds good, but I can live with either of these. |
@daviwil Could this be an extension setting like This could also be something somebody could change via their VSCode_profile. You'd need to decide whether to set this before or after profile processing - considering that the profile could change the working dir. |
@rkeithhill good point on doing it before profile processing, hadn't thought about that. I think having a setting is kindof nice because it makes it clear that this is a configurable option. However, it's kindof moot if the user can just do this in their profile or workspace startup script. What do you think, should we just simplify and allow configuring of starting path via profile? We'd still set it to workspaceRoot by default before profiles get loaded. |
Probably better to start "simplified". You could always add a setting later if folks really need it. Certainly the default working directory is pretty useless. One other thing to think about, is if we ever get a edit time REPL console in VSCode. Would we set that to start in |
That's basically the scenario I filed this for. When I hit F8 in the editor currently, the working directory by default is the VS Code bin path in Program Files. I'd prefer if the path is initialized to be the workspace path so that relative paths in dot source references, etc will resolve correctly when I'm hitting F8 in a script in the workspace. |
I think that depends on the directory structure though. That would certainly work for the Now maybe I misinterpreted this request but even if I did, there's probably going to be folks that don't have their script running from workspaceRoot. Perhaps their script gets put under |
Yep, I'm just thinking about the common case where someone opens a folder and wants to start working on files in that folder. I'd definitely say anyone who wants the working path to be something else should use a profile or workspace init script. |
Currently when a workspace is opened in VS Code the working directory of the PowerShell session is
c:\Program Files (x86)\Microsoft VS Code
. We should set the current directory to the workspace path so that executed commands will be relative to the expected path.The text was updated successfully, but these errors were encountered: