Compare commits
1 Commits
bcf2e92047
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| df23247b07 |
12
agent-cmd.sh
12
agent-cmd.sh
@@ -13,11 +13,21 @@ if [ ${#agents[@]} -eq 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Minimize fzf prompt size while centering it.
|
||||||
|
width=24
|
||||||
|
height=$((${#agents[@]} + 6))
|
||||||
|
hmargin=$((($(tput cols) - width) / 2))
|
||||||
|
vpad=$((($(tput lines) - height) / 2))
|
||||||
|
[ $hmargin -lt 0 ] && hmargin=0
|
||||||
|
[ $vpad -lt 0 ] && vpad=0
|
||||||
|
tput cup "$vpad" 0
|
||||||
|
|
||||||
agent=$(printf '%s\n' "${agents[@]}" | fzf \
|
agent=$(printf '%s\n' "${agents[@]}" | fzf \
|
||||||
--prompt='agent> ' \
|
--prompt='agent> ' \
|
||||||
--reverse \
|
--reverse \
|
||||||
--border=rounded \
|
--border=rounded \
|
||||||
--margin=25%,30% \
|
--height="$height" \
|
||||||
|
--margin="0,$hmargin" \
|
||||||
--padding=1)
|
--padding=1)
|
||||||
|
|
||||||
if [ -n "$agent" ]; then
|
if [ -n "$agent" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user