You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# default navi to print, not to execute
navi() {
if command navi --print "$@" > /tmp/navi_output; then
/usr/bin/glow /tmp/navi_output
else
echo "navi command failed" >&2
return 1
fi
}
_run_last_navi_or_builtin() {
if [ $# -gt 0 ]; then
# Use the built-in . (source) command if arguments are provided
builtin . "$@"
elif [ ! -s /tmp/navi_output ]; then
echo "No navi output found or file is empty. Run 'navi' command first." >&2
return 1
else
# Execute commands from navi output if no arguments
if ! /usr/bin/grep -q '^\$ ' /tmp/navi_output; then
echo "No executable commands found in navi output." >&2
return 1
fi
/usr/bin/grep '^\$ ' /tmp/navi_output | while read -r line; do
cmd="${line#\$ }"
echo "Executing: $cmd"
eval "$cmd"
done
fi
}
alias .="_run_last_navi_or_builtin"
With this you can use navi to search for a comand , and if you want to run it just hit .
The text was updated successfully, but these errors were encountered:
Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)
Hi @alexis-opolka I don't even understand myself now…. I think I meant to use glow or a rich markdown previewer, to display the description of the cheat.
I can't really test it right now, can you please tell me the difference between using navi's input without and with a rich markdown previewer?
A better display?
Use this alias:
With this you can use
navi
to search for a comand , and if you want to run it just hit.
The text was updated successfully, but these errors were encountered: