diff --git a/.config/opencode/plugins/tmux-panes.ts b/.config/opencode/plugins/tmux-panes.ts index 236a0dc..0db57a4 100644 --- a/.config/opencode/plugins/tmux-panes.ts +++ b/.config/opencode/plugins/tmux-panes.ts @@ -30,7 +30,7 @@ const plugin: Plugin = async (ctx) => { const sessions = new Map() // sessionId → tmux paneId const sourcePaneId = getCurrentPaneId() - const serverUrl = ctx.serverUrl?.toString() ?? "" + const serverUrl = (ctx.serverUrl?.toString() ?? "").replace(/\/$/, "") log(`plugin init — serverUrl=${serverUrl} sourcePaneId=${sourcePaneId}`) // Ordered list of pane IDs in the right column. @@ -50,7 +50,7 @@ const plugin: Plugin = async (ctx) => { // Wrap the attach command: on failure, show the error and keep the // pane open for 30 s so we can read it before it disappears. const attachCmd = `opencode attach ${serverUrl} --session ${sessionId}` - const cmd = `bash -c '${attachCmd}; _exit=$?; echo "--- exit: $_exit ---" >> ${DEBUG_LOG}; [ $_exit -ne 0 ] && sleep 30'` + const cmd = `bash -c '${attachCmd}; echo "--- exit: $? ---" >> ${DEBUG_LOG}; sleep 30'` log(`spawning pane — cmd: ${attachCmd}`) let args: string[]