cantino / mcfly

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

`no_ui` option that directly writes the first suggestion to a file #276

Open kmod-midori opened 1 year ago

kmod-midori commented 1 year ago

This should make #85 eaiser to do, since we do not need to deal with the UI popping up. Bypassing the UI should also make mcfly start a little faster.

I was originally wanting to add support for - in output_selection, but since we are doing print! everywhere, this will not be effective as standard output may contain all kinds of messages.

cantino commented 1 year ago

Thanks @chengyuhui. Can you explain a bit more what you hope to use this for?

kmod-midori commented 1 year ago

I hope to have shell scripts call mcfly and get the result without the UI popping up. The linked issue provided a way to arrest the UI with the help of script, but that's not very elegant. In addition, this also removes the overhead of UI starting up, as I will be calling mcfly quite frequently.

cantino commented 1 year ago

Could do the proposal in #307, if it allowed a --limit on the number of returned matches, also meet this PR's goals?

kmod-midori commented 1 year ago

Is it suitable for use when it is called on every key entered into the terminal? If it is, and it does not show the UI, then it should work well.

cantino commented 1 year ago

Are you still working on this?

plawley commented 4 months ago

just a bump that there is definitely interest in this no-ui direct suggestion capability.
-zsh-autosuggestions integration is a bit of a killer app for this type of tool.