Skip to content

'WinIOError' thrown from 'Ctrl+L' was fixed in recent versions #1315

@daxian-dbw

Description

@daxian-dbw
Member

The IOException thrown from Ctrl+l was fixed in recent versions.
If you run into this one (seeing a stack trace like the below one), please try out the latest version of PSReadLine from PowerShell Gallery.

Exception:
System.IO.IOException: The parameter is incorrect.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.SetWindowPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

This issue was fixed by #790. The fix was included in 2.0.0-beta4 and newer versions.
For more information, take a look at #922 (comment).

Activity

ghost added
Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
on Jan 23, 2020
ghost removed
Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
on Jan 23, 2020
added
Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.
on Jan 23, 2020
pinned this issue on Jan 23, 2020
justPaulo

justPaulo commented on Feb 27, 2020

@justPaulo

After update to most recent version of powershell core, error stills persists.

Last 8 Keys:

 Ctrl+l Ctrl+l Ctrl+l Ctrl+l Ctrl+l Ctrl+l Ctrl+l Ctrl+l

Exception:

System.PlatformNotSupportedException: Operation is not supported on this platform.
   at System.ConsolePal.SetWindowPosition(Int32 left, Int32 top)
   at System.Console.SetWindowPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.SetWindowPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ClearScreen(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

vexx32

vexx32 commented on Feb 27, 2020

@vexx32

@justPaulo did you update to the most recent version of PSReadLine?

justPaulo

justPaulo commented on Feb 27, 2020

@justPaulo

No because of:
WARNING: Version '2.0.0-beta3' of module 'PSReadLine' is already installed at '/usr/local/microsoft/powershell/6/Modules/PSReadLine'. To install version '2.0.0', run Install-Module and add the -Force parameter, this command will install version '2.0.0' side-by-side with version '2.0.0-beta3'.

daxian-dbw

daxian-dbw commented on Feb 27, 2020

@daxian-dbw
MemberAuthor

@justPaulo Please try this:

<path-to-pwsh-executable> -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease"

Be sure to exit all instances of powershell.exe, pwsh.exe or pwsh (including the integrated PowerShell console you might opened in VSCode), then run the suggested command from cmd.exe.
Checkout the Upgrading section of the README.md.

justPaulo

justPaulo commented on Feb 27, 2020

@justPaulo

Tried it:
pnascim@MacMinidoPaulo ~ $ /usr/local/bin/pwsh -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease"
WARNING: The version '2.0.0' of module 'PSReadLine' is currently in use. Retry the operation after closing the applications.

I completely closed and logout from pwsh, as well zsh on macOS Catalina.

PS /Users/pnascim> $PSVersionTable Name Value ---- -----
PSVersion 6.2.4
PSEdition Core
GitCommitId 6.2.4
OS Darwin 19.4.0 Darwin Kernel Version 19.4.0: Sun Feb 9 22:12:38 PST 2020; root:xnu-6153.100.196~21/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

daxian-dbw

daxian-dbw commented on Feb 27, 2020

@daxian-dbw
MemberAuthor

@justPaulo There is a thread about this. It looks like something with Install-Module, checkout #1370

46 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @daxian-dbw@justPaulo@vexx32

        Issue actions

          'WinIOError' thrown from 'Ctrl+L' was fixed in recent versions · Issue #1315 · PowerShell/PSReadLine