Skip to content

Error on pressing keys Alt+h when trying to get a description of a parameter #4907

@wrtdghvbn-hash

Description

@wrtdghvbn-hash

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!

### Environment
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.2
OS: Microsoft Windows 10.0.26100
BufferWidth: 120
BufferHeight: 26

Last 63 Keys:

 l s Spacebar - p a Tab Alt+h q Ctrl+c U P d a t e Backspace Backspace Backspace Backspace Backspace p d a t e - H e l Tab Spacebar - Y Backspace U i Tab Spacebar E Backspace e n - U S Enter
 c p p Spacebar Backspace Backspace Backspace Backspace l s Spacebar - p a Tab Alt+h

### Exception

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference
   at CallSite.Target(Closure, CallSite, Object)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Microsoft.PowerShell.PSConsoleReadLine.WriteParameterHelp(Object helpContent)
   at Microsoft.PowerShell.PSConsoleReadLine.WriteDynamicHelpContent(String commandName, String parameterName, Boolean isFullHelp)
   at Microsoft.PowerShell.PSConsoleReadLine.DynamicHelpImpl(Boolean isFullHelp)
   at Microsoft.PowerShell.PSConsoleReadLine.ShowParameterHelp(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Screenshot

Image

Environment data

PS Version: 7.5.2
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.26100.2308 (WinBuild.160101.0800)
BufferWidth: 156
BufferHeight: 36

Steps to reproduce

Insert any commandlet with parameter, don't press Enter. Press Alt+h to get a hint. The exception occurs both in the terminal and in the console.

Expected behavior

Expecting to receive a short hint on the parameter

Actual behavior

We get an exception

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions