PowerShell 和 Windows 终端:如何应用 IntelliSense 建议?

Dar*_*iak 14 terminal keyboard-shortcuts powershell

使用 Windows Terminal (1.15.3465.0) 和 PowerShell (7.3.2) 我收到自动完成建议,如下图所示(ed255196 -C "<comment>"建议完成)。

但是,我无法应用该建议。我尝试了TabEnterCtrl+Enter和一些不同的组合,但这些组合都不起作用。

在此输入图像描述

我该如何应用该建议?

Dav*_*ill 18

如何应用 IntelliSense 建议?

\n

您需要使用右箭头键->

\n
\n

预测的按键绑定

\n

键绑定控制光标移动和预测中的其他功能。\n 为了支持用户在多个平台上运行预测智能感知,用户可以通过命令行或配置文件脚本设置键绑定。

\n

PSReadLine包含导航和接受预测的功能。作为\n示例,要接受显示的预测,PSReadLine\n包含函数:

\n
`AcceptSuggestion` \xe2\x80\x93 Accept the current inline suggestion\n`AcceptNextSuggestionWord` \xe2\x80\x93 Accept the next word of the inline suggestion\n
Run Code Online (Sandbox Code Playgroud)\n

AcceptSuggestion是在 内构建的ForwardChar,默认情况下\n绑定到RightArrowRightArrow当光标位于当前行末尾时,按接受\n内联建议。\n

\n
\n

资料来源:宣布推出带有预测 IntelliSense 的 PSReadLine 2.1+ - PowerShell 团队

\n