aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-03-24 13:36:27 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-03-24 13:36:27 +0800
commitd781c2b4be9c3202a3dc8408078af086eb82ec3c (patch)
tree8bd68b069800489149ef9a3957ae748d602b80bf
parente65d2df31888271808293290a158f74e8246e7f5 (diff)
Update
-rw-r--r--bin/gpt/shellrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/gpt/shellrc b/bin/gpt/shellrc
new file mode 100644
index 0000000..5d70dc6
--- /dev/null
+++ b/bin/gpt/shellrc
@@ -0,0 +1,6 @@
1# Ask GPT what's wrong with the last command
2h() {
3 printf '%s\n\n%s' "$(fc -s 2>&1 >/dev/null)" "Tell me what's wrong with the command above" | \
4 gpt --skip
5}
6trap 'echo -e "\e[31m---Error: press h to get help from AI---\e[0m"' ERR