hyper: $EDITOR is ignored when opening preferences in bash.
Platform / Shell / Hyper version
OS X, Bash, 0.8.1
Steps to reproduce
- Open Hyper with a bash session.
- Set
export EDITOR=vim(or another editor). - Hit
cmd+,to open preferences. ~/.hyper.jswill have opened withnano.
What I expected
I expected ~/.hyper.js to be opened with $EDITOR, in this case vim.
What happened instead
~/.hyper.js was opened with nano.
GIF

Details
The editor fallback was added in #517. At that point, the opening command looked like:
bash -c "exec env ${EDITOR:=nano} ~/.hyper.js"' (src)
In #575, the double quotes were switched to single quotes, with the command becoming:
bash -c 'exec env ${EDITOR:=nano} ~/.hyper.js' (src)
If those two commands are run directly in bash, only the one with double quotes respects the $EDITOR.
Two questions:
- Can anyone else reproduce this?
- If yes, what is the best approach to fix (keeping in mind cross-shell compatibility)?
I am happy to submit a PR once a potential solution has been agreed on. Thanks for your hard work!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (9 by maintainers)
export EDITOR='whatever'instead ofEDITOR='whatever'solved it for meNot related to the issue, but wanted to say you have a beautiful prompt and color scheme 👍
I am still having this issue, opening sublime text for me when I have
in my
.zshrcThis website solved this problem for me (I am using oh-my-zsh): http://linuxg.net/how-to-change-the-default-editor-in-linux/
Hey @timneutkens @robodair - sorry for the confusion regarding the reproduction steps. Thanks for explaining the differences in having
$EDITORset in.bash_profilevs just in the current shell session.I’ve been testing with
$EDITORset via my.bash_profile, however today I discovered that it was only settingEDITOR=vimwithout an export. Shame on me!Setting
export EDITOR=vimin.bash_profileworks for me:Although this doesn’t explain @dak0rn’s experience.
Adding the
-lflag does work either way, as long as$EDITORis somehow set in the profile it will still work.Perhaps this could be a useful addition, just to make sure the edge case is covered? Are the any downsides to using
-l?@dak0rn Possibly related https://github.com/zeit/hyper/issues/699
It’s defined with
export: