News for hackers. Stuff that matters.
Re:Kali Linux 2020.3 by daffy on Monday August 24, 2020 @04:42AM (#24258628)
One nice thing in zsh is that you can type `/u/lo/b<tab><return>` and be in `/usr/local/bin`.
Re:Kali Linux 2020.3 by ti_ranger on Monday August 24, 2020 @06:27AM (#24259231)
This is one of my primary dislikes of zsh ...
Re:Kali Linux 2020.3 by enriquto on Monday August 24, 2020 @05:16AM (#24258803)
Bash does the same thing here, typing tabs instead of slashes.

    /u<TAB>lo<TAB>b
same number of keystrokes actually
Re:Kali Linux 2020.3 by Nullabillity on Monday August 24, 2020 @05:28AM (#24258875)
Not quite. Zsh can use the subfolders to disambiguate which parent you meant, bash can't.
Re:Kali Linux 2020.3 by enriquto on Monday August 24, 2020 @05:33AM (#24258924)
Wow. While this is quite slick (and must have been funny to implement), I actually hate this kind of "magic" behavior.
Re:Kali Linux 2020.3 by polack on Monday August 24, 2020 @06:00AM (#24259098)
I usually hate magic too, but I have to say this is one of the cases where I like it. It's convenient without any danger attached to it since you're just switching directory and not actually executing something against this "unknown" path.
Re:Kali Linux 2020.3 by pletnes on Monday August 24, 2020 @05:52AM (#24259035)
How is it more or less magic than bash’s? It takes more context into account, sure, but it’s easy to understand and reason about.
Re:Kali Linux 2020.3 by Jach on Monday August 24, 2020 @08:50AM (#24260096)
For about a decade I've had in my bashrc

    C() { cd `$HOME/path-selector.sh "$@"`; }
where path-selector is from https://github.com/MarcWeber/path-selector

Opt-in bash extensions can do basically whatever people complain bash can't do. Though to be honest I don't use it that much over the last, say, 5 years. If I know a deep directory tree that well, I can just type it explicitly and/or tab complete it without losing much time. If I don't know it that well, FZF is quite nice.

Re:Kali Linux 2020.3 by nostoc on Monday August 24, 2020 @09:32AM (#24260458)
"bash: /usr/local/bin/: Is a directory"

What to you have in your bashrc to allow cd'ing in directories without typing cd?

Re:Kali Linux 2020.3 by enriquto on Monday August 24, 2020 @09:57AM (#24260671)
I prefer to type "cd", the directory-as-executable feature is a bit confusing for me.

But you can enable it in bash, the option has the same name as in zsh: autocd. Just run "shopt -s autocd".