PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.67k stars 292 forks source link

Keyboard not working with RDP windows host using iOS on pwsh 7.0.0 #1428

Closed schmimps closed 3 years ago

schmimps commented 4 years ago

Steps to reproduce

On iOS, use any iOS RDP app (ms Remote Desktop or Parallels client for example) to access a Windows 10 64bits host. Open Powershell 7.0.0 and type anything. Keyboard doesn’t work. It works with Powershell 6.4 for example as for any other application

The command https://github.com/PowerShell/PSReadLine/issues/1428#issuecomment-603160883 indicates this is a regression in newer version of PSReadLine (or .NET Core 3.1).

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
daxian-dbw commented 4 years ago

@schmimps Can you please try start PowerShell 7 by pwsh -NonInteractive? The PSReadLine module won't be loaded when starting like this. Can you try and see if keyboard works when starting pwsh that way?

schmimps commented 4 years ago

@daxian-dbw You're right, thanks! It works with pwsh -NonInteractive. Will it alway work this way or do you know if this issue will be solved? For information, I downgraded to 6.2.4 and the keyboard was working without -NonInteractive. Then I upgraded to 7.0.0 and the keyboard didn't work until I added the flag.

schmimps commented 4 years ago

@daxian-dbw I tried further with the NonIteractive option. The problem is that I cannot use scripts that ask for something. I can write inside the console, but as soon as I launch a script that asks for an answer, I have an error telling: "PowerShell is in NonInteractive mode. Read and Prompt functionality is not available."

daxian-dbw commented 4 years ago

Thanks @schmimps for trying it out. That's just a way to confirm the issue is related to PSReadLine. I will transfer this issue to the PSReadLine repo for further investigation.

dgoldman-msft commented 4 years ago

I am able to reproduce this on Mac OS High Sierra connecting to Windows 10 64 bit Version 2004 (oS Build 19041.450). Removing PSReadline however does correct the issue. If i downgrade to PSReadline 2.0.0 the problem goes away, it is present on 2.0.2

c:> $PSVersionTable

Name Value


PSVersion 5.1.19041.1 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.1 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

@daxian-dbw, and way to add this issue? I have a confirmed sustainable repro.

daxian-dbw commented 3 years ago

Chatted with @dgoldman-msft offline and it looks this is a regression from 2.0.1 to 2.0.0.

OchoaJason commented 3 years ago

I am also running into this issue with powershell 7.1.3 when I RDP to the system using ARM WVD Web Client. I do not get the issue when I RDP using the 'Remote Desktop' modern app. I tried upgrading PSReadLine to 2.2.0-beta and that did not fix the issue. Removing the PSReadLine module resolved the issue for both PowerShell (5.1.19041.906) and also pwsh.

Bridug commented 3 years ago

I experience this issue with 7.1.3 as well on a 4th Gen iPad Air, iPadOS 14.6 connecting via MS RDP app . PS7 will not take input from the magic keyboard or even the soft keyboard.

SteveL-MSFT commented 3 years ago

I'm able to repro this. The interesting thing is that if you use Windows Terminal, then PS7 w/ PSRL2.2 works fine, just not in the old conhost. Also, up arrow and enter works, just not alpha keys.

dgoldman-msft commented 3 years ago

Steve let me check. I just checked and with you 7.13 with PSR2.1 and above in windows terminal works, still not the old way.

Thanks Dave


From: Steve Lee @.> Sent: Tuesday, June 29, 2021 8:16:36 PM To: PowerShell/PSReadLine @.> Cc: Dave @.>; Mention @.> Subject: Re: [PowerShell/PSReadLine] Keyboard not working with RDP windows host using iOS on pwsh 7.0.0 (#1428)

I'm able to repro this. The interesting thing is that if you use Windows Terminal, then PS7 w/ PSRL2.2 works fine, just not in the old conhost.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/PowerShell/PSReadLine/issues/1428#issuecomment-871003399, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJQPRPGGCB6A3WFQI7JWU43TVJO6JANCNFSM4LUS7VMA.

Sent from mail.dgoldman.org

SteveL-MSFT commented 3 years ago

I would suggest using Windows Terminal until we can figure out what changed between 2.0.0 and 2.0.1 that regressed this

SteveL-MSFT commented 3 years ago

It appears the regression is between 2.0.0 and 1.2.0 and not between 2.0.0 and 2.0.1. This makes it a lot harder to track down the specific change as there were substantial changes between 1.2 and 2.0.

SteveL-MSFT commented 3 years ago

Ok, figured out the problem. Seems like an easy fix. PR soon.

ghost commented 2 years ago

:tada: This issue was addressed in 2632, which has now been successfully released in v2.2.0-beta4. :tada:

fplanque commented 1 year ago

October 2022: still can't type into a Powershell on Windows 11 (fully up to date) when using Remote Desktop from mac.

Oddly enough, I can scroll through the history with arrow up & down , backspace/delete , CTRL+C also works but any printable character gets ignored.

Same with PowerShell 7.2.6.

fplanque commented 1 year ago

If this can help someone:

2022-10-20_23-48-50
daxian-dbw commented 1 year ago

@fplanque Please make sure you are using the latest PSReadLine module (2.2.6 at the moment). The PSReadLine shipped with PowerShell 7.2.6 is 2.1.0, which doesn't contain this fix.

fplanque commented 1 year ago

@daxian-dbw I would like to but I am a new user and I have no idea what the PSReadLine module is and how to update it. Can you point me into the right direction? Thank you.

daxian-dbw commented 1 year ago

Open up the 7.2.6 PowerShell on you Win11 machine, then run the following command:

Install-Module PSReadLine -RequiredVersion 2.2.6 -Scope CurrentUser

Then start a new PowerShell session, and run the following command to verify the version of PSReadLine you are using:

Get-Module PSReadLine  ## you should see 2.2.6
loaderladdy commented 8 months ago

I have been looking for the answer to this problem for so long. The thread for this issue has made me so very happy. Thank you all. am now off to upgrade PSReadline on several computers.

dvmbro commented 6 months ago

@daxian-dbw Thank you! Worked fabulously.