`ShowCommandHelp` (F1) doesn't work for `about_*` topics relating to language keywords, specifically, if the "about_" prefix isn't used.

Open
#3,570 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
cli

Research direction

Start at the ShowCommandHelp implementation and reproduce the F1 behavior in a PowerShell console using the if, about_If, and _if inputs described in the issue. Trace how language keywords are resolved to conceptual help topics. Done means pressing F1 after if displays the about_If help topic while preserving the existing prefixed behavior.

Written by the indexing model from the issue text.

Description

Area-CommandHelp Issue-Enhancement
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
N/A
Screenshot

N/A

Environment data
PS Version: 7.4.0-preview.1
PS HostName: ConsoleHost
PSReadLine Version: 2.2.6
PSReadLine EditMode: Emacs
OS: Darwin JDoes-MacBook-Pro.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64
BufferWidth: 180
BufferHeight: 60
Steps to reproduce

A - currently undocumented - feature of the ShowCommandHelp function (F1) is that it can act on the titles of conceptual help topics (about_*) too - both with and without the about_ prefix (although omitting the prefix sometimes results in surprising behavior).

# OK: Shows help topic about_Scopes in alternate screen buffer, with paging.
PS> scopes # <- press F1 here

However, this doesn't work for language keywords, such as if, while, return, ... - _except_ if the about_` prefix is also used.

# OK, thanks to explicit "about_" prefix
PS> about_If # <- press F1 here

# !! BROKEN: no action is taken
PS> if # <- press F1 here

# WORKAROUND: Use minimal prefix "_"
PS> _if # <- press F1 here

Related, more general problem:

  • #3571
Expected behavior

Typing if followed by F1 should show the about_If help topic.

Actual behavior

Nothing happens.

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.