Skip to content

When running in a docker container PSReadline crashes #3463

@TravisEz13

Description

@TravisEz13

Steps to reproduce

docker run -it microsoft/powershell:windowsservercore
  • type a command

Expected behavior

It should work without error

Actual behavior

PS C:\>
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 3 Keys:
 UpArrow Enter
 r

Exception:
System.ComponentModel.Win32Exception: Incorrect function
-----------------------------------------------------------------------
remove-module psreadline

PS C:\> $Error| fl * -Force


PSMessageDetails      :
Exception             : System.Management.Automation.MethodInvocationException: Exception calling "ReadLine" with "2"
                        argument(s): "Failed to get console font information." ---> System.Exception: Failed to get
                        console font information. ---> System.ComponentModel.Win32Exception: Incorrect function
                           --- End of inner exception stack trace ---
                           at Microsoft.PowerShell.Internal.ConhostConsole.GetConsoleFontInfo(SafeFileHandle
                        consoleHandle)
                           at Microsoft.PowerShell.Internal.ConhostConsole.StartRender()
                           at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()
                           at Microsoft.PowerShell.PSConsoleReadLine.Render()
                           at Microsoft.PowerShell.PSConsoleReadLine.InvokePrompt(Nullable`1 key, Object arg)
                           at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics
                        engineIntrinsics)
                           at CallSite.Target(Closure , CallSite , Type , Object , Object )
                           --- End of inner exception stack trace ---
                           at
                        System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception
                        exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
                           at CallSite.Target(Closure , CallSite , Type , Object , Object )
                           at System.Management.Automation.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
                           at
                        System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
                        frame)
TargetObject          :
CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : Exception
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at PSConsoleHostReadline, C:\program
                        files\powershell\latest\Modules\PSReadLine\PSReadLine.psm1: line 4
PipelineIterationInfo : {}

Environment data

> $PSVersionTable

Name                           Value
----                           -----
SerializationVersion           1.1.0.1
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.17
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
WSManStackVersion              3.0
CLRVersion
PSVersion                      6.0.0-alpha
PSEdition                      Core

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions