From 0604aef3ee79e58d8098cc86d48674d6941abe8b Mon Sep 17 00:00:00 2001 From: Wyatt Walter Date: Thu, 25 Jun 2026 03:21:02 +0000 Subject: [PATCH] fix(supervision): treat NBSP as whitespace in composer detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The claude composer pads its prompt with a non-breaking space (U+00A0), which POSIX [:space:] does not match. An idle "❯" prompt therefore survived the trim in fm_tmux_composer_state, never matched the bare-prompt "empty" case, and classified as pending input. This wedged the away-mode daemon (the composer guard deferred every escalation) and tripped fm-send's swallowed-Enter check on every idle pane. Normalize U+00A0 to a space before trimming. --- bin/fm-tmux-lib.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/fm-tmux-lib.sh b/bin/fm-tmux-lib.sh index 374e358..c256ce6 100755 --- a/bin/fm-tmux-lib.sh +++ b/bin/fm-tmux-lib.sh @@ -127,6 +127,13 @@ fm_tmux_composer_state() { # -> empty|pending|unknown stripped=${line//│/} # U+2502 light vertical (claude) stripped=${stripped//┃/} # U+2503 heavy vertical stripped=${stripped//|/} # ASCII pipe + # Normalize the non-breaking space (U+00A0) the claude composer pads its prompt + # with into an ASCII space. The trim below uses POSIX [:space:], which does NOT + # match U+00A0, so without this an idle "❯" prompt survives the trim, never + # matches the bare-prompt "empty" case, and reads as pending input — wedging the + # away-mode daemon (it deferred 100% of escalations) and tripping fm-send's + # swallowed-Enter check on every idle pane. + stripped=${stripped//$'\xc2\xa0'/ } # U+00A0 NBSP -> ASCII space # Trim surrounding whitespace. stripped="${stripped#"${stripped%%[![:space:]]*}"}" stripped="${stripped%"${stripped##*[![:space:]]}"}"