summaryrefslogtreecommitdiffstats
path: root/scripts/integration.bash
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-02-26 11:28:25 +0800
committerGitHub <noreply@github.com>2024-02-26 11:28:25 +0800
commitff0ec15e065957a0da197711f6e3adfb9992325a (patch)
tree9d0d588d8365b6c850072dd69532995c63b001e7 /scripts/integration.bash
parentaec1b707afb1cf80ff4eb8591e1cd050fffe47b0 (diff)
downloadaichat-ff0ec15e065957a0da197711f6e3adfb9992325a.tar.gz
feat: add shell integration (#323)
Diffstat (limited to 'scripts/integration.bash')
-rw-r--r--scripts/integration.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/integration.bash b/scripts/integration.bash
new file mode 100644
index 0000000..572c7be
--- /dev/null
+++ b/scripts/integration.bash
@@ -0,0 +1,7 @@
+_aichat_bash() {
+ if [[ -n "$READLINE_LINE" ]]; then
+ READLINE_LINE=$(aichat -e "$READLINE_LINE")
+ READLINE_POINT=${#READLINE_LINE}
+ fi
+}
+bind -x '"\ee": _aichat_bash' \ No newline at end of file