Show HN: McFly, a smart Bash history search CLI in Rust with a neural network
github.com
github.com
(ctrl+S and ctrl+R are based on emacs shortcuts, where ctrl+S is search and ctrl+R is reverse search)
ctrl+shift+r works though.
(Not sure why bash did not go the obvious route here, I guess they already had something on ctrl+S when they implemented forward search...)
EDIT: actually, you can activate ctrl+S for search-foward on bash by using `stty -ixon`. See more info about why here https://unix.stackexchange.com/questions/141422/searching-hi...
# use up and down arrow to match search history based on typed starting text
"\e[A": history-search-backward
"\e[B": history-search-forward $ units --verbose
You have: 1 mile * 20 pounds force
You want: joule
1 mile * 20 pounds force = 143174.38 joule
1 mile * 20 pounds force = (1 / 6.98449e-06) joulehttps://github.com/junegunn/fzf/wiki/Examples#command-histor...
PROMPT_COMMAND="__last_exit=\$?;history -a \$MCFLY_HISTORY;mcfly add --exit \$__last_exit --append-to-histfile;history -cr \$MCFLY_HISTORY;${PROMPT_COMMAND}"
Felt good finally writing some code in Rust after the rust lang book.
1. The GUI should display at the bottom of the screen rather than at the top. I found myself constantly having to jump my eyes from the bottom of the terminal where my command was, to the top of the screen.
2. Show the full commands in the search results. Maybe they could be wrapped? Long commands with changes towards the end of the string get chopped off making it hard to know the differences between them in the display.
This also reminds me of one of my dream features for a shell: full dataflow input/output/provenance histories, on a per-file(-version) basis.
For example: show all the commands a certain file has been read from, show the command(s) that wrote to a file, show true steps by which a certain file was constructed from predecessor files/commands, etc.
It makes me want to try a personal project that makes use of a tiny light-weight NN as well. I see giant AlphaGo neural nets mentioned so frequently that I forgot they could be lean :)
P.S. e.g. a polynomial over the metrics. P.P.S. I imagine you’re using the neural network to tune the weights?
From what source? Do users need to worry about people gaming this to have ads show up in results?
http://www.arewelearningyet.com/
thought I'd share in case you/others wanted to avoid coding their own or experiment quickly with other types of models.