Closed goddade closed 4 years ago
I've never seen this before. Can you show me the bash code that you added to your .bashrc
file?
.bashrc
file:
# mcfly
if [[ -f ~/.mcfly/mcfly.bash ]]; then
source ~/.mcfly/mcfly.bash
fi
In the mcfly.bash file, I modified the last few lines:
# if [[ $- =~ .*i.* ]]; then
# if set -o | grep "vi " | grep -q on; then
# bind "'\C-r': '\e0i#mcfly: \e\C-j mcfly search\C-j'"
# else
# bind "'\C-r': '\C-amcfly: \e# mcfly search\C-j'"
# fi
# fi
bind "'\C-r': '\e0i#mcfly: \e\C-j mcfly search\C-j'"
The problem is in the mcfly.bash file.
# Run mcfly with the saved code. It will:
# * append commands to $HISTFILE, (~/.bash_history by default)
# for backwards compatibility and to load in new terminal sessions;
# * find the text of the last command in $MCFLY_HISTORY and save it to the database.
$MCFLY_PATH add --exit ${exit_code} --append-to-histfile
$MCFLY_PATH
is empty.
mcfly.bash sets MCFLY_PATH to MCFLY_PATH=${MCFLY_PATH:-$(which mcfly)}
. Does which mcfly
not return a valid path to the binary for you?
I found the cause of the problem.
The rust environment variable has not been added when sourcing mcfly.bash
.
Is there anything we should add to mcfly.bash to help prevent this?
I think it should provide a useful error message when MCFLY_PATH
is empty.
if [ -z "$MCFLY_PATH" ]; then
echo "Cannot find mcfly, please make sure you have added the rust environment variable before sourcing mcfly.bash."
fi
Great idea. Added in 5e3161d.
Ubuntu 18.04 bash Every time I enter a command, it will show: