Exit status when defaulting to '.'
Created by: other-mickk
My understanding is that autojump
defaults to the current directory (.
) when no match is found, while still exiting with a success status:
$ autojump --stat | grep inexistent # assume 'inexistent' is not in the database
$ autojump inexistent && echo ping
.
ping
The first line is the output from autojump
, the second line from the echo
command. Would it be sensible for autojump
to exit with an error status instead?
My use case is that I find myself using jc some_child_somewhere && run command in child
(sometimes with j
) as a pattern more and more. Sometimes it comes out of habit, but if I use it in the wrong place or I forgot to train the database (e.g. because I moved things around) the command will still be run in the current directory.
Admittedly if this isn’t the right feature for autojump I could hack a script around it.