cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.75k stars 176 forks source link

[Feature Request] Only store commands that return zero #332

Closed MahdiNazemi closed 1 year ago

MahdiNazemi commented 1 year ago

Is there an option to only store commands that have not returned an error?

If not, is adding something like if [[ ${exit_code} == 0]] before this line in mcfly.zsh enough?

cantino commented 1 year ago

mcfly logs the exit code and uses it in the sort weighting, but it still records the command. If you didn't want it to record at all, you'd add it your conditional before this line https://github.com/cantino/mcfly/blob/8633cf2e9daf6bd40bfe50eee4c146c1a4725e4b/mcfly.zsh#L55