首页 > 系统相关 >Windows Terminal PowerShell智能提示

Windows Terminal PowerShell智能提示

时间:2023-01-30 15:24:27浏览次数:54  
标签:Function Set Key Windows PSReadLine Terminal https PowerShell

安装最新版本的PSReadLine

Install-Module PSReadLine -RequiredVersion 2.2.6 -Force

用noteapd $PROFILE打开配置文件,添加如下配置

Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows

Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadLineKeyHandler -Key Tab -Function Complete

参考

https://www.hanselman.com/blog/adding-predictive-intellisense-to-my-windows-terminal-powershell-prompt-with-psreadline
https://devblogs.microsoft.com/powershell/announcing-psreadline-2-1-with-predictive-intellisense/?WT.mc_id=-blog-scottha
https://github.com/PowerShell/PSReadLine

标签:Function,Set,Key,Windows,PSReadLine,Terminal,https,PowerShell
From: https://www.cnblogs.com/joe-yang/p/17076038.html

相关文章