This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Always restart in the original cwd

Nathan Herald (Mar 10, 2026, 10:18 AM +0100) 981731ef 6009d6c0

+29 -4
+14
completions/pty.bash
··· 24 24 COMPREPLY=($(compgen -W "${names}" -- "${cur}")) 25 25 fi 26 26 ;; 27 + run) 28 + # After --, fall back to default file completion 29 + local i 30 + for (( i=2; i < COMP_CWORD; i++ )); do 31 + if [[ "${COMP_WORDS[i]}" == "--" ]]; then 32 + COMPREPLY=($(compgen -o default -- "${cur}")) 33 + return 34 + fi 35 + done 36 + # Before --, complete flags 37 + if [[ "${cur}" == -* ]]; then 38 + COMPREPLY=($(compgen -W "--detach -d --attach -a" -- "${cur}")) 39 + fi 40 + ;; 27 41 esac 28 42 } 29 43
+11 -2
completions/pty.zsh
··· 54 54 _arguments '1:session:_pty_sessions' 55 55 ;; 56 56 run) 57 + # After --, fall back to normal (command + file) completion 58 + local -i i 59 + for (( i=1; i <= $#words; i++ )); do 60 + if [[ "${words[$i]}" == "--" ]]; then 61 + shift $i words 62 + (( CURRENT -= i )) 63 + _normal 64 + return 65 + fi 66 + done 57 67 _arguments \ 58 68 '(-d --detach)'{-d,--detach}'[Create in background]' \ 59 69 '(-a --attach)'{-a,--attach}'[Attach if already running]' \ 60 - '1:name:' \ 61 - '*:command:_command_names -e' 70 + '1:name:' 62 71 ;; 63 72 esac 64 73 ;;
+4 -2
src/cli.ts
··· 258 258 process.exit(1); 259 259 } 260 260 261 - // Clean up any dead session with the same name 261 + // Clean up any dead session with the same name, but preserve cwd 262 + // so that `run -a` re-creates the session in the original directory. 263 + const previousCwd = session?.status === "exited" ? session.metadata?.cwd : undefined; 262 264 if (session?.status === "exited") { 263 265 cleanupAll(name); 264 266 } 265 267 266 268 try { 267 - await spawnDaemon(name, command, args, displayCommand); 269 + await spawnDaemon(name, command, args, displayCommand, previousCwd); 268 270 } finally { 269 271 releaseLock(name); 270 272 }