File tree 3 files changed +7
-4
lines changed
PowerShellEditorServices/Session
PowerShellEditorServices.Protocol/Server
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ protected async Task HandleLaunchRequest(
273
273
// TODO: What's the right approach here?
274
274
if ( this . editorSession . PowerShellContext . CurrentRunspace . Location == RunspaceLocation . Local )
275
275
{
276
- editorSession . PowerShellContext . SetWorkingDirectory ( workingDir ) ;
276
+ await editorSession . PowerShellContext . SetWorkingDirectory ( workingDir ) ;
277
277
Logger . Write ( LogLevel . Verbose , "Working dir set to: " + workingDir ) ;
278
278
}
279
279
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ protected async Task HandleInitializeRequest(
183
183
// Set the working directory of the PowerShell session to the workspace path
184
184
if ( editorSession . Workspace . WorkspacePath != null )
185
185
{
186
- editorSession . PowerShellContext . SetWorkingDirectory (
186
+ await editorSession . PowerShellContext . SetWorkingDirectory (
187
187
editorSession . Workspace . WorkspacePath ) ;
188
188
}
189
189
Original file line number Diff line number Diff line change @@ -1048,9 +1048,12 @@ internal void ReleaseRunspaceHandle(RunspaceHandle runspaceHandle)
1048
1048
/// unescaped before calling this method.
1049
1049
/// </summary>
1050
1050
/// <param name="path"></param>
1051
- public void SetWorkingDirectory ( string path )
1051
+ public async Task SetWorkingDirectory ( string path )
1052
1052
{
1053
- this . CurrentRunspace . Runspace . SessionStateProxy . Path . SetLocation ( path ) ;
1053
+ using ( RunspaceHandle runspaceHandle = await this . GetRunspaceHandle ( ) )
1054
+ {
1055
+ runspaceHandle . Runspace . SessionStateProxy . Path . SetLocation ( path ) ;
1056
+ }
1054
1057
}
1055
1058
1056
1059
/// <summary>
You can’t perform that action at this time.
0 commit comments