mdw-editor: If both VISUAL and EDITOR are set unusually, prefer EDITOR.
[profile] / mdw-editor
index cca7310..8b6e819 100755 (executable)
@@ -2,10 +2,11 @@
 
 set -e
 editor=${MDW_EDITOR-ed}
+[ -t 0 -a -t 1 ] || TERM=dumb
 case "$EDITOR,$VISUAL,$TERM" in
   mdw-editor,mdw-editor,dumb) editor=gnuclient;;
   mdw-editor,mdw-editor,*);;
-  *,mdw-editor,*) editor=$EDITOR;;
   mdw-editor,*,*) editor=$VISUAL;;
+  *,*,*) editor=$EDITOR;;
 esac
 exec $editor "$@"