I encountered some bizarre Bash behavior today, and maybe it's a bug that's since been fixed, but I'm going to ask about it anyway.
I have an x64 Cygwin install on my work computer with Bash 4.3.46 in it. By accident today, instead of typing !533
to run an old command in my history, I typed ~533
. That should have just displayed nothing, since I had an empty directory stack.
But instead, ~n
seems to freeze Bash, for any number n
. Open a brand-new MinTTY with Bash in it, type ~1
and hit Enter, and Bash just disappears into la-la land. Ctrl+C, Ctrl+J, Ctrl+Z, Ctrl+anything can't get you back to a prompt. Characters you type are echoed to the console, which is mildly interesting, since something must still be echoing them. But you can't recover the shell, and you can't even close MinTTY normally — you have to force-kill the Bash process ID.
It's worth noting that dirs +1
, which is supposed to be the equivalent of ~1
(per the Bash manual), works just fine.
I can reliably reproduce this on my work computer. Interestingly, Cygwin Bash 4.4.12 on my home computer works right, so this may be a bug in the 4.3.x versions that they fixed in 4.4.x. If it is a bug, I'll definitely upgrade.
So is this broken tilde behavior a bug? A misconfiguration? Has anyone encountered this behavior before?