chiark / gitweb /
a58ee95ce9a57975496bd2f9a2bf76bb2a62fa36
[profile] / mdw-editor
1 #! /bin/sh
2
3 set -e
4 editor=${MDW_EDITOR-ed}
5 [ -t 0 -a -t 1 ] || TERM=dumb
6 case "$EDITOR,$VISUAL,$TERM" in
7   mdw-editor,mdw-editor,dumb) editor=gnuclient;;
8   mdw-editor,mdw-editor,*);;
9   *,mdw-editor,*) editor=$EDITOR;;
10   mdw-editor,*,*) editor=$VISUAL;;
11 esac
12 exec $editor "$@"