PSReadLine
PSReadLine copied to clipboard
Arch Linux: Interrupted Tab Completion Hangs the Shell
This is an issue migrated from https://github.com/PowerShell/PowerShell/issues/12475.
Steps to reproduce
On linux, type anything that may show the candidates list and then press tab and Ctrl-C
syst<tab>
🕙[ 10:22:44 ] λ systemctl
systemctl systemd-hwdb systemd-run
systemd-analyze systemd-id128 systemd-socket-activate
systemd-ask-password systemd-inhibit systemd-stdio-bridge
systemd-cat systemd-machine-id-setup systemd-sysusers
systemd-cgls systemd-mount systemd-tmpfiles
systemd-cgtop systemd-notify systemd-tty-ask-password-agent
systemd-delta systemd-nspawn systemd-umount
systemd-detect-virt systemd-path systemmonitor
systemd-escape systemd-repart systemsettings5
systemd-firstboot systemd-resolve systool
/usr/bin/systemctl
Then the candidates list disappears (which is expected) but the whole shell hangs.
version
PowerShell 7.1.0-preview.1 and PowerShell 7.1.0-preview.2
profile
# Shows navigable menu of all options when hitting Tab
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
# Autocompletion for arrow keys
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
Notice
Original issue mentioned about starship
, but the problem can be reproduced without it, hence I removed descriptions about starship
.
any update?
@SchrodingerZhu I cannot reproduce this on Ubuntu 16.04 with either PowerShell 7.0.0 (2.0.0 PSReadLine) or PowerShell 7.1.0-preview.2 (2.1.0-beta1 PSReadLine). Which Linux distro were you using?
Arch Linux with latest zen kernel
Linux <HOST> 5.6.8-zen1-1-zen #1 ZEN SMP PREEMPT Wed, 29 Apr 2020 16:23:00 +0000 x86_64 GNU/Linux
Tested again, with both konsole and alacritty
Thanks for the additional information. Please note that Arch Linux is maintained by the community and not officially supported by Microsoft, so it will be a low priority for us to investigate this issue. Just want to set the correct expectation :)
It seems like this issue is alive and well; using Ubuntu 23.04, Powershell 7.3.6 installed via the Microsoft apt repository, I freeze pwsh deterministically with the following:
- install pnp.powershell module (lots of commands)
- set PSReadLineKeyHandler completion for key Tab to MenuComplete
- type pnp-get[tab] (make sure the terminal has enough display space to offer all 200+ options and therefore navigation)
- navigate down in the list twice
- navigate back up once
- hit CTRL-C --> pwsh becomes unresponsive and irrecoverable
Reproduced with terminal hosts Kitty and gnome-terminal, also using Powershell Remoting over SSH.
Being used to CTRL-C to abort, I've been facing a repeatedly hanging shell and lots of frustration.
Seems to be somewhat fixed on the pre-release. Now, it leaves the cursor in the original position but leaves the completed text there. I'm not sure if that's the intended behavior