o: accept sname/aname syntax for new command

This commit is contained in:
Levi Neely 2026-08-13 09:29:00 +02:00
parent 05770ee28b
commit 6465861908
1 changed files with 5 additions and 2 deletions

View File

@ -251,8 +251,11 @@ cmd_log() {
cmd_new() {
if [[ -n "$CTX_AGENT" ]]; then
echo "error: cannot create nested agents" >&2
exit 1
# o session/agent new [cwd] — create the agent in that session
local agent_cwd="${1:-$PWD}"
printf 'name=%s\ncwd=%s\n' "$CTX_AGENT" "$agent_cwd" | ollie-9p write "session/$CTX_SESSION/agent/new"
echo "created agent: $CTX_SESSION/$CTX_AGENT"
return
fi
if [[ -n "$CTX_SESSION" ]]; then