o prompt: use . as send trigger, empty lines add newlines

This commit is contained in:
Ollie Agent 2026-08-04 18:56:47 +02:00
parent 19a96ab2de
commit 8ffbf3b699
1 changed files with 12 additions and 4 deletions

View File

@ -252,7 +252,7 @@ cmd_prompt() {
path="session/$s/agent/$a"
echo "[$s/$a]"
echo "Enter prompts (blank line sends, Ctrl+D exits)."
echo "Type . on a blank line to send, Ctrl+D to exit."
echo "Slash commands: /stop /compact /kill /clear /model /backend /cwd /help"
echo ""
@ -298,10 +298,18 @@ cmd_prompt() {
esac
continue
fi
if [[ "$line" == "." ]]; then
# Send prompt on "." alone
if [[ -n "$buf" ]]; then
history -s "$buf"
printf '%s\n' "$buf" | ollie-9p write "$path/prompt"
buf=""
fi
continue
fi
if [[ -z "$line" && -n "$buf" ]]; then
history -s "$buf"
printf '%s\n' "$buf" | ollie-9p write "$path/prompt"
buf=""
# Empty line during multi-line input: append newline
buf="$buf"$'\n'
elif [[ -z "$line" ]]; then
continue
else