Detection of default texteditor looks like in vipe util.

Check /usr/bin/editor, EDITOR and VISUAL environment variables. Otherwise try to use vim,
emacs or nano.