cantino / mcfly

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

Import splits multiline history entries as multiple commands #432

Open iloveitaly opened 2 months ago

iloveitaly commented 2 months ago

This is documented here but it would be great if there was an option to either (a) omit multiline commands or (b) properly handle them. I may have some time to help with this; mind pointing me in the right direction?

cantino commented 2 months ago

Thanks @iloveitaly, and sorry for the delay. There are probably a few places this needs to be handled:

  1. When importing existing history, which means updating the history file parsers in https://github.com/cantino/mcfly/blob/master/src/shell_history.rs
  2. When adding a new command to the DB (in mcfly.fish as '$argv[1]' for fish, handled in https://github.com/cantino/mcfly/blob/master/src/settings.rs#L344C40-L347C22 for bash and zsh, and possibly not parsing right until 1 is done above)
  3. Displaying in the UI
  4. Outputting commands back to the terminal https://github.com/cantino/mcfly/blob/master/src/main.rs#L48