Powershell: Start-process pwsh -credential $cred <- strange input issue

Created on 5 Oct 2020  路  3Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

in the console:

$cred = get-credential
start-process pwsh -credential $cred

Expected behavior

the same as start-process pwsh but within the context of $cred


Actual behavior

I cannot type in the new console running as $cred... unless I type in the original console running as my user.

If I go to the new console and type, nothing shows nor is executed. However if I switch to the original console and start typing, the characters start to appear in the new console, one by one.
Then, the issue reverts, and I stop being able to write in the original console until I type in the new console.
It looks as though there's only one buffer.


Environment data

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
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
Issue-Question Resolution-Duplicate

All 3 comments

Can you confirm whether this is still happening in the most recent preview/RC releases?

I believe this is a duplicate of https://github.com/PowerShell/PowerShell/issues/12129. IIRC this is a bug in PSReadLine, as running Remove-Module PSReadLine in the parent process fixes up the stdin redirection allowing you to type into both consoles.

Confirmed duplicate, you can close this.
Thank you, I hadn't found it.

Was this page helpful?
0 / 5 - 0 ratings