Use readlink to identify the default editor via /etc/alternatives/editor. ref. #4728

Also use "run" for launching nano because it's not a gui editor.