vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.19k stars 3.5k forks source link

Hyper fails to load bash on Windows 10 #1476

Closed citrusui closed 6 years ago

citrusui commented 7 years ago

Issue

On Windows 10, Hyper seems to fail to initialize the bash shell.

Running Bash from the Linux subsystem works fine, but running it from Hyper does not...

hyperapp-err

Moving .hyper.js to another location temporarily fixes this problem, but, of course, calls cmd.exe instead...

hyper-cmd2bash

Because I am using the Linux subsystem , I thought perhaps Hyper did not like that my .hyper.js was using LF line endings. However, neither CRLF not LF endings had any effect. I theorize that since I am getting the "File not found" error, perhaps Hyper is failing to locate my user directory.

I have uninstalled Hyper several times, and removed it's app directory (%appdata%/Local/hyper). Removing the app and it's various settings did not fix anything.

The output from lsb_release may be of some help... perhaps Ubuntu 16.10 is causing issues?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.10
Release:        16.10
Codename:       yakkety
matheuss commented 7 years ago

@citrusui can you, on cmd.exe, run where bash and then change the value of your shell in the .hyper.js? 😄

citrusui commented 7 years ago

I don't have my Windows box immediately available, but I should be able to test either in a couple of hours or by tomorrow. Should've filed this bug yesterday 😖

citrusui commented 7 years ago

Okay, so setting shell to C:\\Windows\\System32\\bash.exe works as expected now! Unfortunately that means I have to use a separate .hyper.js for macOS and Linux.

Perhaps a setting like win.shell could be added? Windows is the only OS using the .exe extension for executables.

Anahkiasen commented 7 years ago

Since this is a JS file and not a JSON file, is there not an environment variable that can be used, more simply? Like

'shell': process.env.OS === 'Windows' ? 'C:/System32/bash.exe' : '/usr/local/bin/bash',

Or something? Or would that not work depending on how Hyper loads the configuration

Stanzilla commented 6 years ago
shell: 'C:\\Windows\\System32\\wsl.exe',

// for setting shell arguments (i.e. for using interactive shellArgs: ['-i'])
// by default ['--login'] will be used
shellArgs: [],