Skip to content

Commit 7b11751

Browse files
authored
Merge pull request #1989 from psicho2000/feat/preview-via-jq
Use jq to preview json if installed
2 parents 91cf949 + 7fe13b0 commit 7b11751

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/preview-tui

+6
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ handle_ext() {
323323
elif exists bsdtar; then
324324
fifo_pager bsdtar -tvf "$1"
325325
fi ;;
326+
json)
327+
if exists jq; then
328+
fifo_pager jq --color-output '.' "$1"
329+
else
330+
fifo_pager pager "$1"
331+
fi ;;
326332
*) if [ "$3" = "bin" ]; then
327333
fifo_pager print_bin_info "$1"
328334
else

0 commit comments

Comments
 (0)