Skip to content

Commit 69c3d63

Browse files
committed
Draw the preview header on kernel, snapshot and diff screens
1 parent 83b2cbb commit 69c3d63

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

90zfsbootmenu/zfsbootmenu-lib.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ draw_kernel() {
7171
benv="${1}"
7272

7373
selected="$( fzf --prompt "${benv} > " --tac --expect=alt-d \
74-
--with-nth=2 --header="[ENTER] boot [ALT+D] set default [ESC] back" < "${BASE}/${benv}/kernels" )"
74+
--with-nth=2 --header="[ENTER] boot [ALT+D] set default [ESC] back" \
75+
--preview-window=up:2 \
76+
--preview="zfsbootmenu-preview.sh ${BASE} ${benv} ${BOOTFS}" < "${BASE}/${benv}/kernels" )"
7577
ret=$?
7678
# shellcheck disable=SC2119
7779
csv_cat <<< "${selected}"
@@ -89,7 +91,9 @@ draw_snapshots() {
8991

9092
selected="$( zfs list -t snapshot -H -o name "${benv}" |
9193
fzf --prompt "Snapshot > " --tac --expect=alt-x,alt-c,alt-d \
92-
--header="[ENTER] duplicate [ALT+X] clone and promote [ALT+C] clone only [ALT+D] show diff [ESC] back" )"
94+
--preview="zfsbootmenu-preview.sh ${BASE} ${benv} ${BOOTFS}" \
95+
--preview-window=up:2 \
96+
--header="[ENTER] duplicate [ALT+X] clone and promote [ALT+C] clone only [ALT+D] show diff [ESC] back" )"
9397
ret=$?
9498
# shellcheck disable=SC2119
9599
csv_cat <<< "${selected}"
@@ -124,7 +128,9 @@ draw_diff() {
124128
( zfs diff -H "${snapshot}" "${diff_target}" & echo $! >&3 ) 3>/tmp/diff.pid | \
125129
sed "s,${mnt},," | \
126130
fzf --prompt "Files > " \
127-
--bind 'esc:execute-silent( kill $( cat /tmp/diff.pid ) )+abort'
131+
--preview="zfsbootmenu-preview.sh ${BASE} ${diff_target} ${BOOTFS}" \
132+
--preview-window=up:2 \
133+
--bind 'esc:execute-silent( kill $( cat /tmp/diff.pid ) )+abort'
128134

129135
test -f /tmp/diff.pid && rm /tmp/diff.pid
130136
umount "${mnt}"

0 commit comments

Comments
 (0)