Skip to content

Commit 5fac828

Browse files
committed
Fix bad math expression error when IFS doesn't contain space
When the previous prompt contains highlight and IFS doesn't contain space, calling filter-select results in the following error: filter-select:136: bad math expression: operator expected at `14 fg=blue...' This is fixed by specifying the delimiter for the read command.
1 parent a38b278 commit 5fac828

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/filter-select

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function filter-select() {
251251
if [[ "${hi}" == P* ]]; then
252252
init_region_highlight+="${hi}"
253253
else
254-
print -r -- "${hi}" | read start end spec
254+
print -r -- "${hi}" | read -d ' ' start end spec
255255
init_region_highlight+="P$(( start + ${#orig_predisplay} )) $(( end + ${#orig_predisplay} )) $spec"
256256
fi
257257
done

0 commit comments

Comments
 (0)