diff --git a/data/scripts/o b/data/scripts/o index d4d794c..9c4ca0f 100755 --- a/data/scripts/o +++ b/data/scripts/o @@ -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