Skip to content

Completions while remoting are from local context #2661

@lookcloser

Description

@lookcloser

System Details

System Details Output

### VSCode version: 1.44.2 ff915844119ce9485abfe8aa9076ec76b5300ddd x64

### VSCode extensions:
ms-vscode-remote.remote-ssh@0.51.0
ms-vscode-remote.remote-ssh-edit@0.51.0
ms-vscode.notepadplusplus-keybindings@1.0.5
ms-vscode.powershell-preview@2020.3.0


### PSES version: 2.1.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When I use the integrated console with version 2020.4.0 of the extension, and I am connected to a remote server using PowerShell remoting, file path autocompletion does not run in the remote session.

I type "cd ", then the first few letters of the file path, then hit Tab, and nothing happens. I expect it to start autocompleting the file path when I hit Tab.

  • File path autocompletion works when accessing the local file system (i.e. when not using remoting).
  • It works when using remoting if I set "powershell.integratedConsole.useLegacyReadLine" to true.
  • It also works when using remoting in the initial console that VS Code loads (as opposed to the "PowerShell Integrated Console").

This problem does not happen when using version 2020.3.0 of the extension.

I believe that this issue was introduced in the 2020.3.1-preview release, because it works for me in 2020.3.0-preview but not in 2020.3.1-preview.

The log entries for a successful use of autocompletion with 2020.3.0-preview look like this:

2020-04-24 08:59:57.925 -05:00 [VRB] StartReadLoop called while read loop is already running
2020-04-24 08:59:57.925 -05:00 [VRB] Attempting to execute command(s):

    prompt

2020-04-24 08:59:57.925 -05:00 [VRB] Session state changed --

    Old state: Ready
    New state: Running
    Result: NotFinished
2020-04-24 08:59:58.002 -05:00 [VRB] Session state changed --

    Old state: Running
    New state: Ready
    Result: Completed
2020-04-24 08:59:58.002 -05:00 [VRB] Execution completed successfully.
2020-04-24 08:59:58.003 -05:00 [VRB] Attempting to execute command(s):

    
            [System.Diagnostics.DebuggerHidden()]
            [System.Diagnostics.DebuggerStepThrough()]
            param()
            return [Microsoft.PowerShell.PSConsoleReadLine, Microsoft.PowerShell.PSReadLine2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]::ReadLine(
                $Host.Runspace,
                $ExecutionContext,
                $args[0]) System.Threading.CancellationToken

Meanwhile, they look like this for 2020.3.1-preview:

2020-04-24 08:53:32.884 -05:00 [VRB] StartReadLoop called while read loop is already running
2020-04-24 08:53:32.884 -05:00 [VRB] Attempting to execute command(s):

    prompt

2020-04-24 08:53:32.888 -05:00 [VRB] Session state changed --

    Old state: Ready
    New state: Running
    Result: NotFinished
2020-04-24 08:53:32.971 -05:00 [VRB] Session state changed --

    Old state: Running
    New state: Ready
    Result: Completed
2020-04-24 08:53:32.971 -05:00 [VRB] Execution completed successfully.
2020-04-24 08:53:32.977 -05:00 [VRB] Attempting to execute command(s):

    __Invoke-ReadLineForEditorServices -CancellationToken System.Threading.CancellationToken

2020-04-24 08:53:47.898 -05:00 [VRB] Execution completed successfully.

Attached Logs

logs.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions