diff --git a/lib/actions/ui.js b/lib/actions/ui.js index d9bca1bf..0ca2b0a5 100644 --- a/lib/actions/ui.js +++ b/lib/actions/ui.js @@ -137,6 +137,7 @@ export function moveTo (i) { } export function showPreferences () { + const editorFallback = process.platform === 'win32' ? 'notepad' : 'nano'; return (dispatch, getState) => { dispatch({ type: UI_SHOW_PREFERENCES, @@ -150,7 +151,7 @@ export function showPreferences () { // Leading space prevents command to be store in shell history [' echo Attempting to open ~/.hyperterm.js with your \$EDITOR', // eslint-disable-line no-useless-escape ' echo If it fails, open it manually with your favorite editor!', - ' bash -c "exec env $EDITOR ~/.hyperterm.js"', + ' bash -c "exec env ${EDITOR:=' + editorFallback + '} ~/.hyperterm.js"', '' ].join('\n') ));