I can set my EDITOR variable in my .bashrc to e.g. gedit, which is a nice graphical editor on ubuntu. But when I log in over PuTTY that editor will fail.
What is the best way to detect if I'm logged in and can run a graphical editor, or not, and set EDITOR appropriately??