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
215215fi
216216
217217running=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)
220221if [ -n " $prompt " ]; then
221222 pipe_mode_prompt=${prompt}
222- # if input file_descriptor is a terminal
223+ # if input file_descriptor is a terminal, run on chat mode
223224elif [ -t 0 ]; then
224225 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
227227else
228228 pipe_mode_prompt+=$( cat -)
229229fi
You can’t perform that action at this time.
0 commit comments