# HG changeset patch # User Augie Fackler # Date 1616378889 14400 # Node ID ea947b2b04a08147ce54936b5519459f08e2dfba # Parent a6d9af3fdc5056ecce9482baeb026ef7b2caf678 zsh: update mcfly support to 1d1d5892b0c8 diff --git a/.shell.d/99.mcfly.zsh b/.shell.d/99.mcfly.zsh --- a/.shell.d/99.mcfly.zsh +++ b/.shell.d/99.mcfly.zsh @@ -28,6 +28,10 @@ export MCFLY_SESSION_ID=$(dd if=/dev/ura # Find the binary MCFLY_PATH=${MCFLY_PATH:-$(which mcfly)} +if [[ -z "$MCFLY_PATH" || "$MCFLY_PATH" == "mcfly not found" ]]; then + echo "Cannot find the mcfly binary, please make sure that mcfly is in your path before sourcing mcfly.bash." + return 1 +fi # Required for commented out mcfly search commands to work. setopt interactive_comments # allow comments in interactive shells (like Bash does) @@ -52,7 +56,7 @@ function mcfly_prompt_command { # Run mcfly with the saved code. It fill find the text of the last command in $MCFLY_HISTORY and save it to the database. [ -n "$MCFLY_DEBUG" ] && echo "mcfly.zsh: Run mcfly add --exit ${exit_code}" - $MCFLY_PATH add --exit ${exit_code} + $MCFLY_PATH --history_format zsh add --exit ${exit_code} return ${exit_code} # Restore the original exit code by returning it. } precmd_functions+=(mcfly_prompt_command) @@ -71,14 +75,19 @@ if [[ $- =~ .*i.* ]]; then echoti rmkx exec