cantino / mcfly

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

Feature request: Better exit-code based experience? #351

Open dgollahon opened 1 year ago

dgollahon commented 1 year ago

Hi,

Thank you for a wonderful tool. One frustration I have is I often auto-complete a known-failing command. Would it be possible to improve the UX of this? Ideas I had:

  1. color recently failing commands in red (or otherwise mark them in some way)
  2. have an option to always sort failing commands below non-failing commands
  3. try to somehow recognize when something has failed for a specific reason/when it can't even run? i'm not sure if there's a reasonable way to do this, especially across shells, but I really care about this for cases like when I typo git as gti or something similar to that. I often run commands that might reasonably have a failing status sometimes but I really don't want to rerun commands that are very, very unlikely to pass like typos. If it's a command not found: ... I wish I could exclude it. I did notice there's a cmd_tpl normalization in the sqlite db--I wonder if that could be used to find out if the command could possibly be in the path..?
  4. record if the command has only failed and weight that lower? so if I run make test or something and it fails some of the time, it shouldn't necessarily be penalized but gti will never ever pass.

If I have a clear idea of what you would support or recommend I'd be happy to try and send a PR if that's welcome/helpful.

Thanks!

dgollahon commented 1 year ago

Oh, and one more thought/possible feature: allow deleting without confirmation. I think if I could just hit F2 or some keystroke without having to then confirm with y it would be easier to remove commands I don't want anymore.

cantino commented 1 year ago

Hey @dgollahon, thanks for the suggestions!

There is a MCFLY_DELETE_WITHOUT_CONFIRM environment option already.

I like the idea of coloring failing commands (or maybe only always failing commands?) differently. Would you want to work on this?

dgollahon commented 1 year ago

There is a MCFLY_DELETE_WITHOUT_CONFIRM environment option already.

Oh, great. Should that be added to the README? Or is there a different place for extended docs? I'm not sure how I would have discovered that.

Would you want to work on this?

Yeah, I would be interested. I'm not sure exactly when I can do it but would be happy to try at some point.

cantino commented 1 year ago

Fixed in db63e4b, thanks!

cantino commented 1 year ago

Didn't mean to close the issue, since your color-coding of failing commands is still a good idea.