From 2a5db9841935d84108632e408848409893334235 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 19 Nov 2011 14:10:39 +0000 Subject: [PATCH] Also check for empty $PAGER/$VISUAL/$EDITOR in i3-sensible-{editor,pager} --- i3-sensible-editor | 4 ++-- i3-sensible-pager | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/i3-sensible-editor b/i3-sensible-editor index dffe00d5..d71a440b 100755 --- a/i3-sensible-editor +++ b/i3-sensible-editor @@ -4,8 +4,8 @@ # # Distributions/packagers can enhance this script with a # distribution-specific mechanism to find the preferred pager. -which $VISUAL >/dev/null && exec $VISUAL "$@" -which $EDITOR >/dev/null && exec $EDITOR "$@" +[ -n "$VISUAL" ] && which $VISUAL >/dev/null && exec $VISUAL "$@" +[ -n "$EDITOR" ] && which $EDITOR >/dev/null && exec $EDITOR "$@" # Hopefully one of these is installed (no flamewars about preference please!): which nano >/dev/null && exec nano "$@" diff --git a/i3-sensible-pager b/i3-sensible-pager index 5af8d6b4..32f30aff 100755 --- a/i3-sensible-pager +++ b/i3-sensible-pager @@ -4,7 +4,7 @@ # # Distributions/packagers can enhance this script with a # distribution-specific mechanism to find the preferred pager. -which $PAGER >/dev/null && exec $PAGER "$@" +[ -n "$PAGER" ] && which $PAGER >/dev/null && exec $PAGER "$@" # Hopefully one of these is installed: which most >/dev/null && exec most "$@" -- 2.39.5