diff --git a/lib/actions/ui.js b/lib/actions/ui.js index 28557e56..aeafd779 100644 --- a/lib/actions/ui.js +++ b/lib/actions/ui.js @@ -201,11 +201,14 @@ export function moveTo(i) { } export function showPreferences() { + const isWin = process.platform === 'win32'; // eslint-disable-next-line no-template-curly-in-string - const command = process.platform === 'win32' ? ' start notepad "%userprofile%\\.hyper.js"' : ' bash -c \'exec env ${EDITOR:=nano} ~/.hyper.js\''; - const message = process.platform === 'win32' ? + const command = isWin ? ' start notepad "%userprofile%\\.hyper.js"' : ' bash -c \'exec env ${EDITOR:=nano} ~/.hyper.js\''; + const message = []; + message.push(isWin ? ' echo Attempting to open ^%userprofile^%\\.hyper.js with notepad' : - ' echo Attempting to open ~/.hyper.js with your \\$EDITOR'; + ' echo Attempting to open ~/.hyper.js with your \\$EDITOR'); + message.push(' echo If it fails, open it manually with your favorite editor!'); return dispatch => { dispatch({ @@ -217,9 +220,8 @@ export function showPreferences() { rpc.once('session data', () => { dispatch(sendSessionData( uid, - [ // Leading space prevents command to be stored in shell history - ' echo Attempting to open ~/.hyper.js with your \$EDITOR', // eslint-disable-line no-useless-escape - message, + [ + ...message, command, '' ].join('\n\r')