Disable PowerShell beep on backspace Win10
When pressing Backspace in PowerShell, it will emit a 'beep' sound if there is no (more) text to delete. This is quite annoying if you accidentally hold down the key too long, as the sound will keep going for a short while after you release it.
Solution :
Solution :
The beep is provided by the
PSReadline module, which shipped with Windows 10. You need to change the PSReadline option to disable the bell:Set-PSReadlineOption -BellStyle None
If you want this change for all future PowerShell sessions, then you need to add this command to your PowerShell profile. For example, to set the option for "Current User, Current Host" (
$Profile):Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
if (!(Test-Path -Path "$Profile")) {New-Item -ItemType File -Path "$Profile" -Force}
Add-Content -Value "Set-PSReadlineOption -BellStyle None" -Path "$Profile"
The first line allows your profile run a startup script when PowerShell opens (About Execution Policies). The second line tests to see if you already have a startup script defined for "Current User, Current Host". The third line adds the bell option to your startup script.
评论
发表评论