Skip to content

Check $VISUAL before $EDITOR

Motivation

Currently GHCi checks the $EDITOR environment variable to set the editor which is launched by :edit. There is another environment variable $VISUAL which is also used for selecting the default editor on Unix. I use both, but as is suggested in this post on StackExchange, I set $EDITOR to ex and $VISUAL to vi. Thus GHCi always launches ex instead of the desired vi.

Proposal

I suggest simply checking the $VISUAL variable first, and only if it is unset then using $EDITOR. Other command-line tools do this, for example Git.

The change would have to be made here I think. I don't know enough about monads or IO to do this myself though.

GHCi ~"feature request" Plow

Edited by Olius
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information