debug(tmux-panes): strip trailing slash, always hold pane open 30s
This commit is contained in:
@@ -30,7 +30,7 @@ const plugin: Plugin = async (ctx) => {
|
|||||||
|
|
||||||
const sessions = new Map<string, string>() // sessionId → tmux paneId
|
const sessions = new Map<string, string>() // sessionId → tmux paneId
|
||||||
const sourcePaneId = getCurrentPaneId()
|
const sourcePaneId = getCurrentPaneId()
|
||||||
const serverUrl = ctx.serverUrl?.toString() ?? ""
|
const serverUrl = (ctx.serverUrl?.toString() ?? "").replace(/\/$/, "")
|
||||||
log(`plugin init — serverUrl=${serverUrl} sourcePaneId=${sourcePaneId}`)
|
log(`plugin init — serverUrl=${serverUrl} sourcePaneId=${sourcePaneId}`)
|
||||||
|
|
||||||
// Ordered list of pane IDs in the right column.
|
// 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
|
// 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.
|
// pane open for 30 s so we can read it before it disappears.
|
||||||
const attachCmd = `opencode attach ${serverUrl} --session ${sessionId}`
|
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}`)
|
log(`spawning pane — cmd: ${attachCmd}`)
|
||||||
|
|
||||||
let args: string[]
|
let args: string[]
|
||||||
|
|||||||
Reference in New Issue
Block a user