making bluefish as editor require X
authorChris Koeritz <fred@gruntose.com>
Wed, 15 Nov 2017 19:27:56 +0000 (14:27 -0500)
committerChris Koeritz <fred@gruntose.com>
Wed, 15 Nov 2017 19:27:56 +0000 (14:27 -0500)
scripts/core/variables.sh

index 0628a4f1d017f197bfcc79bb579f652c7c030fb3..b64b167098c89726696ab05b7edb3ebeddf51ea4 100644 (file)
@@ -311,8 +311,11 @@ done
 # a late breaking action is to set the editor, if we can.
 # we will fallback to whatever we can find on the host.
 export EDITOR
-if [ -z "$EDITOR" ]; then
-  EDITOR="$(which bluefish)"
+if [ ! -z "$DISPLAY" ]; then
+  # only try to add bluefish, a gui editor, if there is an X display for it.
+  if [ -z "$EDITOR" ]; then
+    EDITOR="$(which bluefish)"
+  fi
 fi
 if [ -z "$EDITOR" ]; then
   EDITOR="$(which gvim)"