From 469f95d3988ca200e58f25088196273ac5c12a52 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Fri, 27 Feb 2026 11:42:18 -0800 Subject: [PATCH 1/3] Fix split-button browser flow to seed terminal split --- Sources/Workspace.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Sources/Workspace.swift b/Sources/Workspace.swift index 1d00b7b8..e43cdf2b 100644 --- a/Sources/Workspace.swift +++ b/Sources/Workspace.swift @@ -3998,15 +3998,16 @@ extension Workspace: BonsplitDelegate { return } - // Get the focused terminal in the original pane to inherit config from - guard let sourceTabId = controller.selectedTab(inPane: originalPane)?.id, - let sourcePanelId = panelIdFromSurfaceId(sourceTabId), - terminalPanel(for: sourcePanelId) != nil else { return } + // Mirror Cmd+D behavior: split buttons should always seed a terminal in the new pane. + // When the focused source is a browser, inherit terminal config from nearby terminals + // (or fall back to defaults) instead of leaving an empty selector pane. + let sourceTabId = controller.selectedTab(inPane: originalPane)?.id + let sourcePanelId = sourceTabId.flatMap { panelIdFromSurfaceId($0) } #if DEBUG dlog( "split.didSplit.autoCreate pane=\(newPane.id.uuidString.prefix(5)) " + - "fromPane=\(originalPane.id.uuidString.prefix(5)) sourcePanel=\(sourcePanelId.uuidString.prefix(5))" + "fromPane=\(originalPane.id.uuidString.prefix(5)) sourcePanel=\(sourcePanelId.map { String($0.uuidString.prefix(5)) } ?? "none")" ) #endif From fac3b12eb70ab4e5887acf907a4a7b47eeee6d79 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Fri, 27 Feb 2026 11:54:37 -0800 Subject: [PATCH 2/3] Avoid auto-killing tagged app instances in reload script --- scripts/reload.sh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/scripts/reload.sh b/scripts/reload.sh index 3cd2bb63..b73bbc96 100755 --- a/scripts/reload.sh +++ b/scripts/reload.sh @@ -327,24 +327,28 @@ else fi osascript -e "tell application id \"${BUNDLE_ID}\" to activate" || true -# Safety: ensure only one instance is running. -sleep 0.2 -PIDS=($(pgrep -f "${APP_PATH}/Contents/MacOS/" || true)) -if [[ "${#PIDS[@]}" -gt 1 ]]; then - NEWEST_PID="" - NEWEST_AGE=999999 - for PID in "${PIDS[@]}"; do - AGE="$(ps -o etimes= -p "$PID" | tr -d ' ')" - if [[ -n "$AGE" && "$AGE" -lt "$NEWEST_AGE" ]]; then - NEWEST_AGE="$AGE" - NEWEST_PID="$PID" - fi - done - for PID in "${PIDS[@]}"; do - if [[ "$PID" != "$NEWEST_PID" ]]; then - kill "$PID" 2>/dev/null || true - fi - done +# Safety: keep a single untagged instance, but do not auto-kill tagged runs. +# Tagged runs are intentionally parallel/isolated and can look like "launch then close" +# if we aggressively prune processes right after `open`. +if [[ -z "$TAG" ]]; then + sleep 0.2 + PIDS=($(pgrep -f "${APP_PATH}/Contents/MacOS/" || true)) + if [[ "${#PIDS[@]}" -gt 1 ]]; then + NEWEST_PID="" + NEWEST_AGE=999999 + for PID in "${PIDS[@]}"; do + AGE="$(ps -o etimes= -p "$PID" | tr -d ' ')" + if [[ -n "$AGE" && "$AGE" -lt "$NEWEST_AGE" ]]; then + NEWEST_AGE="$AGE" + NEWEST_PID="$PID" + fi + done + for PID in "${PIDS[@]}"; do + if [[ "$PID" != "$NEWEST_PID" ]]; then + kill "$PID" 2>/dev/null || true + fi + done + fi fi if [[ -n "${TAG_SLUG:-}" ]]; then From e5aa6f6de7ed2beb3eba41af057105e3e21e4a79 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Fri, 27 Feb 2026 12:01:29 -0800 Subject: [PATCH 3/3] Revert "Avoid auto-killing tagged app instances in reload script" This reverts commit fac3b12eb70ab4e5887acf907a4a7b47eeee6d79. --- scripts/reload.sh | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/scripts/reload.sh b/scripts/reload.sh index b73bbc96..3cd2bb63 100755 --- a/scripts/reload.sh +++ b/scripts/reload.sh @@ -327,28 +327,24 @@ else fi osascript -e "tell application id \"${BUNDLE_ID}\" to activate" || true -# Safety: keep a single untagged instance, but do not auto-kill tagged runs. -# Tagged runs are intentionally parallel/isolated and can look like "launch then close" -# if we aggressively prune processes right after `open`. -if [[ -z "$TAG" ]]; then - sleep 0.2 - PIDS=($(pgrep -f "${APP_PATH}/Contents/MacOS/" || true)) - if [[ "${#PIDS[@]}" -gt 1 ]]; then - NEWEST_PID="" - NEWEST_AGE=999999 - for PID in "${PIDS[@]}"; do - AGE="$(ps -o etimes= -p "$PID" | tr -d ' ')" - if [[ -n "$AGE" && "$AGE" -lt "$NEWEST_AGE" ]]; then - NEWEST_AGE="$AGE" - NEWEST_PID="$PID" - fi - done - for PID in "${PIDS[@]}"; do - if [[ "$PID" != "$NEWEST_PID" ]]; then - kill "$PID" 2>/dev/null || true - fi - done - fi +# Safety: ensure only one instance is running. +sleep 0.2 +PIDS=($(pgrep -f "${APP_PATH}/Contents/MacOS/" || true)) +if [[ "${#PIDS[@]}" -gt 1 ]]; then + NEWEST_PID="" + NEWEST_AGE=999999 + for PID in "${PIDS[@]}"; do + AGE="$(ps -o etimes= -p "$PID" | tr -d ' ')" + if [[ -n "$AGE" && "$AGE" -lt "$NEWEST_AGE" ]]; then + NEWEST_AGE="$AGE" + NEWEST_PID="$PID" + fi + done + for PID in "${PIDS[@]}"; do + if [[ "$PID" != "$NEWEST_PID" ]]; then + kill "$PID" 2>/dev/null || true + fi + done fi if [[ -n "${TAG_SLUG:-}" ]]; then