Skip to content

Commit 45febd3

Browse files
committed
fix(overlay): pre-fill rule editor fields with current values via read -i
1 parent 9ca489a commit 45febd3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/overlay-dialog.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,15 @@ while true; do
434434
# Two-field editor below.
435435
printf '\033[H\033[2J'
436436
printf "${BOLD}Edit Rule${RESET}\n\n"
437-
printf "Edit each field. Leave blank to keep the suggested value.\n\n"
438-
printf "Tool regex ${DIM}[%s]${RESET}: " "$prop_tool"
437+
printf "Edit each field (pre-filled, use arrow keys to navigate).\n\n"
438+
printf "Tool regex: "
439439
edited_tool=""
440-
IFS= read -r -e -t "$TIMEOUT" edited_tool || true
440+
IFS= read -r -e -i "$prop_tool" -t "$TIMEOUT" edited_tool || true
441441
[ -z "$edited_tool" ] && edited_tool="$prop_tool"
442442
if [ -n "$prop_match_key" ]; then
443-
printf "Match %s ${DIM}[%s]${RESET}: " "$prop_match_key" "$prop_match_val"
443+
printf "Match %s: " "$prop_match_key"
444444
edited_match=""
445-
IFS= read -r -e -t "$TIMEOUT" edited_match || true
445+
IFS= read -r -e -i "$prop_match_val" -t "$TIMEOUT" edited_match || true
446446
[ -z "$edited_match" ] && edited_match="$prop_match_val"
447447
prop_match_val="$edited_match"
448448
fi

0 commit comments

Comments
 (0)