GIT_EDITOR TTY fix

Fix for #786.