I just installed Bash on Ubuntu on Windows and I modified my .hyper.js file in order to force Hyper to open Bash shell. Then, when I open Hyper, an error message appears:
// the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
//
// Windows
// - Make sure to use a full path if the binary name doesn't work
// - Remove `--login` in shellArgs
//
// Bash on Windows
// - Example: `C:\\Windows\\System32\\bash.exe`
//
// Powershell on Windows
// - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
shell: 'C:\\Windows\\System32\\bash.exe',
// for setting shell arguments (i.e. for using interactive shellArgs: ['-i'])
// by default ['--login'] will be used
shellArgs: ['--command=usr/bin/bash.exe', '-l', '-i'],
Hyper is closed clicking on OK.
Ok, so modifying the value of shellArgs from ['--command=usr/bin/bash.exe', '-l', '-i']
to ['--login']
, I can use Hyper perfectly without any JS error.
I'm getting the same error with the latest git-bash 2.16.1.2 and canary 11. I haven't been able to find a shell arguments combo that works. No plugins enabled. My hyper.js
Microsoft Windows [Version 10.0.15063]
Hyper 2.0.0-canary.11 (stable)
Plugins: none
I never had this issue until upgrading to 2.0.
Ok, so this is what fixed it for me. My shell was cmd.exe and my shellArgs was /c ubuntu
. I switched the shell to wsl.exe with no args and it loads now.
@jonathanlinat can you reproduce this in 2.0.0?
I reproduce the same issue with 2.0.0
version. I got a fresh Windows 10 install, and here is the only changed configuration:
{
shell: 'C:\\Windows\\System32\\bash.exe',
}
@albinekb I can reproduce a similar issue with 2.0.0
using this configuration:
By the way, as commented here, if I use this configuration, I can use Hyper perfectly without any JS error:
After digging into it, I have succeeded in solving the issue using the following configuration, inspired from @cfjedimaster:
{
shell: 'wsl.exe',
// for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
// by default `['--login']` will be used
shellArgs: [],
}
Note we need to pass an empty array, not an array with an empty string.
Moreover, I also had to install the Ubuntu package from Windows store, to get all Linux utilities.
This way, I finally got a working terminal! \o/
Been using hyper for months and suddenly this appeared on my 2.x install. Would error out every time i opened Hyper.
I switched to C:\\Windows\\System32\\wsl.exe
and an empty string for args (unlike what jpetitcolas said), then tried with --login
as the arg which didnt produce the 'resize' error but just caused Hyper to immediately close upon opening.
I then reverted back to my original configuration - bash.exe with --login - and it started working again. Odd.
Suggest reopening this issue. I just got this again. I think it has something to do with launching hyper on an external monitor, then changing to another external monitor or disconnecting it.
I have found a working workaround,
first I changed compatibility mode to windows 8
then run hyper, it starts but errors out.
close the terminal and change compatibility back to default
run hyper and it starts up
I think causing this other error actually sets somethings straight in the application
edit:
this workaround does not work with multiple monitors tho...
Can we please reopen? i get this on an almost daily basis now. Definitely to do with starting hyper on dual monitors, shutting down and starting it on only one
I have the same issue, probably because options I try to pass are incorrect, but idk how to make it work, this is why I am asking for help here. My portion of .hyper.js
shell: 'C:\\Windows\\System32\\wsl.exe',
shellArgs: ['-C /home/comp']
When you run wsl with this option from cmd or shortcut it opens terminal in a /home/comp folder instead of /mnt/c/Users/User and I need it.
Hyper runs ok without any values in shellArgs
upd: I found the solution https://github.com/zeit/hyper/issues/1998#issuecomment-355807977
I have also received this error when I try to maximize on a 2560x1440 monitor. If I slowly, manually resize, it hits this once it gets to a particular size as well.
Happy to provide more information if needed.
Yeah this definitely seems to be related to hyper not finding the shell it expects. I was using fish on OSX and had to uninstall Homebrew (which deleted fish) and I suddenly started getting this error.
To fix it I manually edited ~/.hyper.js
and replaced shell: '/usr/local/bin/fish',
with shell: '/bin/bash',
. Hyper immediately loaded normally (in bash of course) after that. Would be great for it to handle that a little better, or at least show a sensible error message.
I get this error very regularly. Sometimes hyper just works, and sometimes it crashes this way..
My settings are:
shell: 'C:\\Windows\\System32\\bash.exe',
shellArgs: ['--login'],
Got the same error on Windows. I tried what @mikemorain did, just resized the window and it worked.
In general, you guys want to use wsl.exe instead of bash.exe, bash.exe is deprecated.
Same thing happened again today. Had to resize 7-8 times to resolve.
I've also changed my shell to wsl.exe
and removed --login
from the shell options. Hope this makes the error stay away for good. 馃
Got the same issue, found a workaround / fix though!
shell: 'C:\\Windows\\System32\\wsl.exe',
//causes error:
shellArgs: ['{C0335157-GUID-FROM-YOUR-DISTRIBUTION} ~'],
//works fine:
shellArgs: ['{C0335157-GUID-FROM-YOUR-DISTRIBUTION}','~'],
So, seems like if there's any (unescaped?) spaces in your parameter(s), you will need to add a new string to the array.
EDIT: noticed too late that OP's arguments haven't had any spaces. Whoops. Maybe this will still help some though.
TLDR:
Solution for me:
shell: 'C:\\Windows\\System32\\wsl.exe',
shellArgs: [],
This issue still reproduces on Windows 10, version 2.0.0. Anything I add in the shell
argument in hyper.js causes the exception. I am on two monitors. The arguments are the default ones: shellArgs: ['--login']
Attempted commands in shell:
C:\\Windows\\System32\\wsl.exe
C:\\Windows\\System32\\bash.exe
wsl.exe
bash.exe
What fixed it for me was removing all shellArgs, which indeed stopped the exceptions from popping (now it's complaining i don't have a distribution installed).
So for me this had something to do with WSL taking longer to initiate with Windows when i changed my monitor configuration (i.e. disconnected my external). It's very strange, but I read a topic about it in some forum that there's a delayed start to WSL in certain scenarios (i can't remember the link). Attempting to launch Hyper.js before this process will give this error. Eventually it will work.
However, this was with my classic installation of bash via the console. Since installing from the windows store, i think this issue has gone away.
I think this due to a race condition fixed in 2.1.0-canary.2
thanks to https://github.com/zeit/hyper/pull/2940
Can you confirm it?
Most helpful comment
After digging into it, I have succeeded in solving the issue using the following configuration, inspired from @cfjedimaster:
Note we need to pass an empty array, not an array with an empty string.
Moreover, I also had to install the Ubuntu package from Windows store, to get all Linux utilities.
This way, I finally got a working terminal! \o/