File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -215,15 +215,15 @@ if [ ! -f ~/.chatgpt_history ]; then
215
215
fi
216
216
217
217
running=true
218
- # check input source
219
- # prompt from argument
218
+ # check input source and determine run mode
219
+
220
+ # prompt from argument, run on pipe mode (run once, no chat)
220
221
if [ -n " $prompt " ]; then
221
222
pipe_mode_prompt=${prompt}
222
- # if input file_descriptor is a terminal
223
+ # if input file_descriptor is a terminal, run on chat mode
223
224
elif [ -t 0 ]; then
224
225
echo -e " Welcome to chatgpt. You can quit with '\033[36mexit\033[0m'."
225
- # if prompt already entered, run on pipe mode (run once, no chat)
226
- # prompt from pipe
226
+ # prompt from pipe or redirected stdin, run on pipe mode
227
227
else
228
228
pipe_mode_prompt+=$( cat -)
229
229
fi
You can’t perform that action at this time.
0 commit comments