Post #3913827
2026-07-18 15:17 UTC
I had an issue where logging in to a terminal on this laptop would lock up (but would continue if I hit Control+C). I traced it to a line in my .bash_functions:
if inst trans && grep -q 'Translate Shell' $(which trans); then
It was locking up, because inst (defined as function inst { type "$@" >/dev/null 2>&1; }) was returning a 0, but then $(which trans) wasn't giving any output.
I opened a terminal, hit Control+C, and ran (and got) the following:
rld@prometheus:~$ type trans
trans is /home/rld/.local/bin/trans
rld@prometheus:~$ which trans
rld@prometheus:~$
HOW?!?!?
My fix was to change that line to:
if inst trans && grep -q 'Translate Shell' $(which trans) </dev/null; then
To force grep to not hang.
Now both type and which find it:
rld@prometheus:~$ type trans
trans is /home/rld/.local/bin/trans
rld@prometheus:~$ which trans
/home/rld/.local/bin/trans
rld@prometheus:~$ which -a trans
/home/rld/.local/bin/trans
rld@prometheus:~$
I'm so confuzzled.
But when I revert that change, I'm back to this!
rld@prometheus:~$ type trans
trans is /home/rld/.local/bin/trans
rld@prometheus:~$ which trans
rld@prometheus:~$ echo $?
1
rld@prometheus:~$ which -a trans
rld@prometheus:~$ echo $?
1
rld@prometheus:~$
Very confused. XD
Replies (1)
-
@TerminalTilt@social.terminaltilt.com 2026-07-18 15:32
@rl_dane@polymaths.social I'm no expert, but to me it seems the fact that which works after login but not during login strongly suggests a PATH or shell initialization ordering issue. Something in the login sequence isn't seeing .local/bin yet.