Replies: 1 comment
-
I'm now using a slightly modified version, which prevents duplicate _sgpt_bash() {
if [[ -n "$READLINE_LINE" ]]; then
# Remove any leading # and space characters
READLINE_LINE=${READLINE_LINE##\#*([[:space:]])}
history -s "# $READLINE_LINE"
READLINE_LINE=$(sgpt --shell <<< "$READLINE_LINE")
READLINE_POINT=${#READLINE_LINE}
fi
} Also I think it would be better to store this function in a separate file and only add a line to bashrc sourcing that file, that way it is easy to update the script in future versions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It would be useful to save the input text to the shell history with shell integration. This can be done by modifying the shell function like
Happy to make a PR for this if you agree.
Beta Was this translation helpful? Give feedback.
All reactions