X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/e04c4857c4c68005c13413a3e89abcbfdd81760c..9db17a6585945476ab270ae7ed9d21cea89a60d4:/mdw-editor diff --git a/mdw-editor b/mdw-editor index cca7310..8b6e819 100755 --- a/mdw-editor +++ b/mdw-editor @@ -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 "$@"