Add Windows support and first-class Linux support #946

Merged
merged 32 commits into from Nov 11, 2016
@matheuss
Collaborator
matheuss commented Oct 31, 2016 edited

TODO

Summary

  • child_pty => pty.js to enable Windows support (7f29ead)
  • A brand new interface for Linux and Windows (macOS stays untouched) (9dbff52):

screen shot 2016-10-30 at 8 34 15 pm
screen shot 2016-10-30 at 8 35 11 pm

Why this new design 🤔

When you create a frameless window, you need to specify -webkit-app-region: drag in CSS to tell Electron which regions are draggable.
Electron's documentation states:

Note that if you have made the whole window draggable, you must also mark buttons as non-draggable, otherwise it would be impossible for users to click on them

The problem is that on macOS, the above is simply not true. An element specified as the draggable region will receive click events:

kapture 2016-10-28 at 16 56 30

On Linux and Windows, the behavior is the one described in the documentation – the element will not receive click events:

kapture 2016-10-28 at 2 07 50
(On Windows/Linux you can drag the window too, I just didn't recorded it)

With that in mind, we introduced a new <div> that becomes visible on Windows/Linux when there are two or more open tabs:

kapture 2016-10-30 at 22 47 59

Building on Windows

To build on Windows you need to install some dependencies and run some commands:

  1. Install VC++ Build Tools Technical Preview using the Default Install option
  2. Install Python 2.7, add it to your PATH and run npm config set python python2.7
  3. Run npm config set msvs_version 2015 --global

About pty.js

We're using @Tyriar's fork of pty.jsthe same used on Visual Studio Code. Check #190 for a discussion on that.

Feeback wanted

We need your feedback to make sure this feature is 💯 👌 💅 for the upcoming 1.0.0 release! Any help is more than welcome, especially with tests on Windows and Linux (and macOS too, to make sure that there are no unexpected side effects) 😄

Closes #167; Closes #190; Closes #795;

@matheuss matheuss added this to the v1.0.0 milestone Oct 31, 2016
@matheuss matheuss changed the title from Feature/windows linux to Add Windows support and first-class Linux support Oct 31, 2016
@luisrudge

will we be able to run cmder inside of it? http://cmder.net/

@AlmirKadric

OH S**T it's finally here
You've got yourself a tester 👍

@factormystic
factormystic commented Oct 31, 2016 edited

Windows:

  1. running npm start for the first time there's no errors, but just a blank black window. After restarting the app, getting an unhandled Exception when starting a new tab (any way; via new tab, new window, split action, etc):
    TypeError: spawn is not a function
  2. Maximizing by clicking the maximize button seems to be resizing the window to the size of the active display, but dragging the window still works and doesn't restore the window as it should
  3. Snap actions don't work (eg, drag the window to the right side of the screen & release should snap the window to 50% of the display width). Related to this, is that minimizing doesn't animate like normal windows. This is probably due to whatever your electron window configuration is, I believe if you go full borderless you don't get this functionality automatically.
  4. The app name & icon when right clicking the task bar icon, and also after pinning the app, is Electron (but maybe this is due to running in development?)
@matheuss
Collaborator
matheuss commented Oct 31, 2016 edited

@factormystic:

1: Ops, I forgot to write about that on the PR description.

1.1 Install VC++ Build Tools Technical Preview using the Default Install option
1.2 Install Python 2.7, add it to your PATH and run npm config set python python2.7
1.3 Run npm config set msvs_version 2015 --global
1.4 del node_modules && del app/node_modules
1.5 npm install

This is necessary to build pty.js and should fix the issue 😄 I'll add instructions to the PR description and README.md

2 and 3: I'll look into that 😄

4: Yeah, this happens when you're running in dev mode – it works as expected when you run the bundled application 😄

@matheuss
Collaborator
matheuss commented Oct 31, 2016 edited

@luisrudge I don't think so 🤔 From what I understood, Cmder is a terminal emulator itself, a full app. Is that correct?

But you can use bash 😄

screen shot 2016-10-31 at 12 50 56 am

@paulcbetts
Contributor
paulcbetts commented Oct 31, 2016 edited

A few bugs I noticed:

  • You need to handle --squirrel-install and friends, or else you won't get a shortcut
  • If you set your shell to Windows-on-Linux bash (i.e. C:\Windows\System32\bash.exe), history doesn't work (i.e. type a command hit enter, then hit up to see it again, it doesn't work)
  • The default font list doesn't include any Windows fonts
  • QuickEdit doesn't work - this is a Windows thing that old people like me use, where you can select text, right click to copy it, then clear the selection and right-click to paste
  • No context menu on right-click

A very good start!

@ppot
Collaborator
ppot commented Oct 31, 2016

@matheuss Maybe using pty.js will fix the TypeError: spawn is not a function I also receive on my macOS! Strange. Appends sometimes!

@supnate
supnate commented Oct 31, 2016

Really cool! But how do you guys make pty.js work on Windows!

@fhelwanger

It would be nice to have an option on Windows explorer context menu to "Open Hyper here" the same way we can open Atom in some folder:

image

@matheuss
Collaborator

@supnate we're using @Tyriar's fork – all the credit goes to him 😄

@Tyriar
Contributor
Tyriar commented Oct 31, 2016

Looks great @matheuss 😃, just wanted to let you know some stuff about VS Code's situation so you're all aware:

  • This fork has been used in VS Code since the integrated terminal shipped (based on xterm.js and this pty.js fork)
  • I consider the state of the fork to be a little messy right now, you can see a summary of the issues here Microsoft/vscode#13625 - if you proceed with this please subscribe to this issue
  • As @paulcbetts calls out there are some issues with history doesn't work, there are also some other issues such as ctrl+c not working to kill process, and some other keys not working while in other terminals such as mongodb and ruby shells. Another annoying bug is that sometimes the prompt gets out of sync, I haven't identified yet if the cause for this is pty.js or xterm.js
  • All Windows pty.js issues for VS Code are being tracked here which is definitely worth a read. I consider most of these to be artifacts of using an old version of winpty in pty.js
  • The actual changes to get it working for VS Code weren't major, but since then there have been some pretty big bug fixes (thanks to @the-ress) https://github.com/Tyriar/pty.js/commits/prebuilt

Despite all these shortcomings, AFAIK it's the best option for all platforms which is why we're using it 😃. It's been on my backlog for a while to spend a sprint to clean up this situation as while many people are happy with the Windows experience, I find it frustrating jumping over from Linux which is so smooth.

@jahe
jahe commented Oct 31, 2016 edited

I followed the updated instructions in the pr description and by npm start I get an "Uncaught Exception: TypeError: spawn is not a funciton" just like @factormystic:
exception
Any idea why this happens?

@cchamberlain

@jahe - What's your node --version / npm -v?

@jahe
jahe commented Oct 31, 2016 edited

@cchamberlain

node --version
v6.7.0

npm -v
3.10.3
@Vailfire
Vailfire commented Oct 31, 2016 edited

Getting the same error as @jahe and @factormystic.
I followed the instructions, but I have Visual Studio 2015 with Visual C++ Tools installed.

F:\Projekte\Web\hyper>node --version && npm -v
v6.7.0
3.10.3

F:\Projekte\Web\hyper>npm start

> @ start F:\Projekte\Web\hyper
> concurrently --kill-others --raw "npm run dev" "npm run app"


> @ dev F:\Projekte\Web\hyper
> webpack -w


> @ app F:\Projekte\Web\hyper
> electron app



Webpack is watching the files…

Cannot find module '..\build\Release\pty.node'
A native module failed to load. Typically this means you installed the modules incorrectly.
 Use `scripts/install.sh` to trigger the installation.
 More information: https://github.com/zeit/hyper/issues/72
running in dev mode
electron will open file://F:\Projekte\Web\hyper\app\index.html
Checking for notification messages
ignoring auto updates during dev
No matching notification messages
Hash: fc3fed944d45e1799f8c
Version: webpack 2.1.0-beta.25
Time: 5325ms
           Asset    Size  Chunks             Chunk Names
       bundle.js  4.4 MB       0  [emitted]  main
assets\icons.svg  1.8 kB          [emitted]
    + 317 hidden modules
@Specro
Contributor
Specro commented Oct 31, 2016

I also get "spawn is not a function" and during install get errors during child_pty rebuild. Here's a gist.

@matthewp

Would you like bug reports here, or does that create too much noise? Would be happy to wait until this lands. I've noticed some issues but probably not serious enough to block merging.

@matheuss
Collaborator

@matthewp for sure, feel free to report everything here 😄 If you'd like to have a chat, head to zeit.chat 😌

@matheuss
Collaborator
matheuss commented Oct 31, 2016 edited

@jahe @Vailfire I can't reproduce 😔 From a fresh Windows 10 install, I did exactly what I described in the instructions and it was enough to build pty.js 😕

@Specro from your gist, looks like that you're running on master, since you're getting child_pty errors. Please make sure that you're on the correct branch 😄

FWIW:

node --version && npm --version
v6.9.1
3.10.8
+ matrix:
+ - platform: x64
+
+image: Visual Studio 2015
@Tyriar
Tyriar Oct 31, 2016 Contributor

@matheuss are you sure you need this, VS Code's appveyor.yml doesn't have anything like it? Having said that, I don't know much about how images are used in appveyor.

@matheuss
matheuss Oct 31, 2016 Collaborator

@Tyriar looks like Install-Product node 6 x64 is enough 😅 I'll try to remove it later. Thanks for your concern!

@matthewp

Ok, here's a few things that i've noticed. With Windows 10 and:

> node -v
v7.0.0
> npm -v
3.10.8
  • Ctrl+t doesn't create a new tab. The file menu works however.
  • Using Bash for Windows history doesn't work (I think this is noted elsewhere).
  • Paste doesn't work most of the time. I've seen it work some times, but can't figure out a pattern to get it to work. Copy seems to work fine, but that's not used as much (for me at least).
@Specro
Contributor
Specro commented Oct 31, 2016 edited

@matheuss Whoops :D Yup, now it works correctly. I noticed that after some commands the name goes blank on the titlebar. For example, after npm -v it changes to npm and after that to nothing. Same with tab titles. Will test more.

@jahe
jahe commented Oct 31, 2016

@matheuss I'm running the following system: windows 8.1 pro - 64 Bit - node v6.7.0 - npm 3.10.3 - Python 2.7.12 - Kaspersky 10.2.1.23

I've noticed that the output is slightly different when I run npm start in an administrator cmd. The "Uncaught Exception: TypeError: spawn is not a funciton" error occurs either way.

Output without administrator cmd:

npm start

> @ start D:\envs\dev\playground\hyper
> concurrently --kill-others --raw "npm run dev" "npm run app"

using node@v6.7.0

> electron app


> @ dev D:\envs\dev\playground\hyper
> webpack -w


Webpack is watching the files…

Hash: fc3fed944d45e1799f8c
Version: webpack 2.1.0-beta.25
Time: 43976ms
           Asset    Size  Chunks             Chunk Names
       bundle.js  4.4 MB       0  [emitted]  main
assets\icons.svg  1.8 kB          [emitted]
    + 317 hidden modules

Output with adminstrator cmd:

npm start

> @ start D:\envs\dev\playground\hyper
> concurrently --kill-others --raw "npm run dev" "npm run app"


> @ dev D:\envs\dev\playground\hyper
> webpack -w


> @ app D:\envs\dev\playground\hyper
> electron app



Webpack is watching the files…

Cannot find module '..\build\Release\pty.node'
A native module failed to load. Typically this means you installed the modules incorrectly.
 Use `scripts/install.sh` to trigger the installation.
 More information: https://github.com/zeit/hyper/issues/72
running in dev mode
electron will open file://D:\envs\dev\playground\hyper\app\index.html
Checking for notification messages
ignoring auto updates during dev
No matching notification messages
Hash: fc3fed944d45e1799f8c
Version: webpack 2.1.0-beta.25
Time: 48857ms
           Asset    Size  Chunks             Chunk Names
       bundle.js  4.4 MB       0  [emitted]  main
assets\icons.svg  1.8 kB          [emitted]
    + 317 hidden modules
@Vailfire
Vailfire commented Oct 31, 2016 edited

After several attempts, I got it finally working for me. I'll try to describe all steps, although I don't know which step fixed the problem exactly.

At first, make sure that your feature/windows-linux branch is up-to-date and you deleted your node_modules and app/node_modules folders.

1. Ensure you have an actual node.js and npm version installed

node --version && npm --version
v7.0.0
3.10.8

2. Install necessary node_gyp build tools (according to https://github.com/nodejs/node-gyp#readme)

npm install --global --production windows-build-tools

Expected output

3. Ensure that your python variable points to the installed executable

I already had python in my PATH variable, pointing to C:\tools\python2 (like described at https://docs.python.org/2.7/using/windows.html#finding-the-python-executable). The python npm environment variable also pointed to that location. I changed it to point to the actual executable.

npm config set python C:\tools\python2\python.exe

python --version
Python 2.7.11

(Actual I think the problem was here)

4. Install dependencies

npm i

Expected output

5. Try to build hyper

npm start

Expected output

6. If it does not work yet?

We can try to compile pty.js to verify that node_gyp is working as expected. Running the windows tests ensures that it is theoretically working when all tests are passed.

cd app/node_modules/pty.js

npm i

npm run test-windows

Expected output

@jahe @matheuss Hope this can help anyone. 😄

@madcampos

@luisrudgecmder is a standalone app it uses conemu as it's "terminal emulator". The other tools provided by it like clink should work.

@factormystic @matheuss: window maximizing/minimizing and snapping probably have to do with the way electron renders a frameless window similar issues can be found in nw.js frameless window. In my last nw.js app I solved it in userland code, but the solution is probably outdated now.

Will give it a try and report bugs here. 😉

@madcampos

Issues found:

  1. Characters like '"~` get duplicated when inserted in the terminal, like we would expect from a IDE (image)
  2. Some characters are rendered as (replacement character) although when run command like dir in a Unicode folder it works fine (image)
  3. Line height gets too tight when window is resized
  4. The contents don't update properly when the window is resized (image)
    5. Some emojis don't show (most likely a issue with cmd itself) (image)
  5. Sometimes when the window is maximized than unmaximized the last line gets cut

The content update one is "solved" if i run vim and sometimes cls, it seems that running something that cleans the screen may solve the issue.

Also I got the following errors when closing the app with the exit command.

[11864:1102/023137:ERROR:gles2_cmd_decoder.cc(14664)] [.RenderWorker-000001B3F4AE71C0]GL ERROR :GL_INVALID_VALUE : glCopySubTextureCHROMIUM: source texture has no level 0
[11864:1102/023137:ERROR:gles2_cmd_decoder.cc(14664)] [.RenderWorker-000001B3F4AE71C0]GL ERROR :GL_INVALID_VALUE : glCopySubTextureCHROMIUM: source texture has no level 0
[11864:1102/023137:ERROR:gles2_cmd_decoder.cc(14664)] [.RenderWorker-000001B3F4AE71C0]GL ERROR :GL_INVALID_VALUE : glCopySubTextureCHROMIUM: source texture has no level 0
[11864:1102/023137:ERROR:gles2_cmd_decoder.cc(14664)] [.RenderWorker-000001B3F4AE71C0]GL ERROR :GL_INVALID_VALUE : glCopySubTextureCHROMIUM: source texture has no level 0
[11864:1102/023137:ERROR:gles2_cmd_decoder.cc(14664)] [.RenderWorker-000001B3F4AE71C0]GL ERROR :GL_INVALID_VALUE : glCopySubTextureCHROMIUM: source texture has no level 0
[11864:1102/023137:ERROR:gles2_cmd_decoder.cc(14664)] [.RenderWorker-000001B3F4AE71C0]GL ERROR :GL_INVALID_VALUE : glCopySubTextureCHROMIUM: source texture has no level 0
[11864:1102/023137:ERROR:gles2_cmd_decoder.cc(14664)] [.RenderWorker-000001B3F4AE71C0]GL ERROR :GL_INVALID_VALUE : glCopySubTextureCHROMIUM: source texture has no level 0
@jcolesio
jcolesio commented Nov 2, 2016

When calling bash from the window. All of the text seems to be highlighted gray.
test

@zbuttram
Contributor
zbuttram commented Nov 2, 2016 edited

Any chance we could get AppVeyor to spit out the packaged version as an artifact? Would love to test but I don't have a machine I'm comfortable installing Python 2 on at the moment.

Edit: Disregard this. See the post below from @madcampos for an alternative to installing Python 2.

@madcampos

@zbuttram I used windows build tools to build, it installs python and visual c++ compilers in a way that it don't conflict with another installations (I use python 3 by default)

@tobihrbr
tobihrbr commented Nov 2, 2016

Wow looks really nice. The design really fits windows.

@zbuttram
Contributor
zbuttram commented Nov 2, 2016 edited

Thanks @madcampos, I can also confirm that totally works! Everything seems to be running fine for me. A little slow (like input lag slow), but I'm assuming that's due to running the dev build.

EDIT: Can confirm things are much faster with a packaged version (from running npm run pack).

EDIT 2: Doesn't look like this has been mentioned anywhere else, but the fix from #176 doesn't seem to be holding true in Windows. Not sure if that deserves a new issue or not.

EDIT 3: Not sure where the issue would be with this one, but I'm also noticing that using the arrow keys (up and down) for history works in the Windows CMD shell, but not in bash or zsh running under the WSL.

@fhelwanger

@jahe I was having the same error using npm@3.10.3. Just updated to 3.10.9 and it worked.

@Tyriar
Contributor
Tyriar commented Nov 3, 2016

On functionality within WSL, there is an upstream issue which causes issues within pty.js (and other ptys). Microsoft/BashOnWindows#111

@jahe
jahe commented Nov 3, 2016

@fhelwanger thanks a lot. I updated to node v6.9.1 and npm v3.10.8 and it works like a charme!

@jahe
jahe commented Nov 3, 2016 edited

Some things i noticed during test with hyper.exe:

  • Closing one of multiple hyper windows causes every hyper window to close instead of just the one being closed
  • (Like @Specro already said) Creating multiple Tabs. Initially the title contains "Shell". An "npm -v" causes the title to be blank whereas a simple "dir" command leaves the title "Shell". image
  • Decreasing the hyper window width and increasing it again causes the current working directory to be displayed cut image
@jcolesio
jcolesio commented Nov 3, 2016

Any one having issues running bash.exe besides the arrow keys? Still cant figure out why the text is being highlighted when using bash.exe

@flybayer
Contributor
flybayer commented Nov 3, 2016

Linux Ubuntu 14.04 Feedback

As a standalone window next to the default terminal:

image

Hyper fullscreen:

image

Vs. Gnome Terminal fullscreen:

image

How the menu appears when fullscreen:

image

Feedback

  1. We need a config option for swapping the location of the hamburger menu and window controls. On some Linux distros, window controls are on the left, and others have them on the right. (See the mismatch compared to the default terminal in the above top screenshot)
  2. We need a config option for hiding the custom Hyper menu bar when fullscreen. Some Linux distros show the menu bar at the top like OSX (like the bottom screenshot), but others don't, often when the "task bar" is on the bottom of the screen like Microsoft Windows.
  3. Something is goofy with the Hyper custom menu elements. I often have to click several times before a click actually registers. I'm not sure if it's due to the size of the click area or something else.
@rumpelsepp

The new titlebar with close, maximize and minimize buttons does not make sense in tiling window managers. :/

@flybayer
Contributor
flybayer commented Nov 4, 2016

@rumpelsepp I wondered about that. What is best for tiling window managers? Have a config option to hide the entire title bar?

@rumpelsepp
rumpelsepp commented Nov 4, 2016 edited

@rumpelsepp I wondered about that. What is best for tiling window managers? Have a config option to hide the entire title bar?

Yep. And maybe let it be toggleable by alt or something.

@jcolesio
jcolesio commented Nov 5, 2016

Noticed that if I start hypertern from Cygwin. I don't get the highlighting issues and I'm able to ssh into machines as needed .

@apiep
apiep commented Nov 6, 2016

Tab / Topbar feedback,
can you use chrome tab bar behavior instead of the current implementation?

When unmaximized, it show a little gap between the window border and tab.
chrome-tab-unmaximized
And when the window are maximized it will cover the whole area
chrome-tab-maximized

I dont know how hard it is to implement something like that, maybe by adding some empty draggable div below the tab list? 😁

@lednhatkhanh

+1 for @apiep idea, that's far nicer and easier to use than the current implementation!

@stefanivic
Contributor

Just to add another bug i noticed. Setting bash as default shell in Windows trows an error :
https://i.gyazo.com/c1cb57e35de727cf7b7234cd9ec1369c.png

@Tyriar
Contributor
Tyriar commented Nov 8, 2016

@stefanivic which bash and what path are you using? If you just used bash this is expected.

@stefanivic
Contributor

@Tyriar i tried to use %systemroot%\system32\bash and even to directly point to zsh shell with %systemroot%\system32\bash -c /usr/bin/zsh.

@Tyriar
Contributor
Tyriar commented Nov 8, 2016 edited

@stefanivic some suggestions:

  • Use the extension when referring to the path, it's a shell shortcut to leave out the extension.
  • Isn't %systemroot% normally the drive, not the Windows directory?
  • Also try sysnative over system32, eg. C:\\Windows\\sysnative\\bash.exe
@stefanivic
Contributor
stefanivic commented Nov 8, 2016 edited

@Tyriar got it, i didn't use double . C:\Windows\System32\bash.exe this is what i ended with. Works now.

@jcolesio
jcolesio commented Nov 8, 2016

@stefanivic

Do you experience weird highlighting when using bash.exe?
image

@btd
btd commented Nov 8, 2016

@jcolesio @stefanivic I do not have now, but had because of wrong markup in my PS1 variable.
default

@jcolesio
jcolesio commented Nov 8, 2016 edited

@btd
Thanks. Time to see what mess I have setup.

Edit:
[\e]0;\u@\h: \w\a]${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$

I noticed when I exit out of bash.exe, hyperterm console continues to highlight.
image

@Tyriar
Contributor
Tyriar commented Nov 8, 2016

I would guess that the background highlighting is related to hterm and/or hyper's styles somehow, Haven't seen that in vscode which uses xterm.js.

@Specro
Contributor
Specro commented Nov 8, 2016

I'm interested if there will be someway to change to elevated prompt cause without it things like chocolatey are hard to use. Two more things I noticed:

  • cls doesn't clear the screen correctly if there's more text on the screen than there's height:
    cls-bug
  • arrow keys don't work in bash nano :/ I guess this is the same bug as bash history thing.

Also if anybody needs these, here's a gist of registry entries for menus @fhelwanger described. Just add the path to hyper executable.

@RangerMauve

@Specro I'm pretty sure the CLS behavior you're seeing is working the same way it would in the regular windows console.

@jcolesio
jcolesio commented Nov 8, 2016

@Tyriar

Trying to set back to default to see if that is the issue but this is totally different to the Mac OS version.

For Windows version, its telling me to edit hyper.js

@stefanivic
Contributor
stefanivic commented Nov 8, 2016 edited

@jcolesio @btd Nah, no problems here.

@Specro
Contributor
Specro commented Nov 8, 2016

@RangerMauve I thought so too but when I tried that in the command prompt it clears everything and brings the scrollbar to the top. It doesn't leave any parts of text above.

@madcampos

@RangerMauve @Specro I think i saw the same cls behavior in conemu. IIRC cls clears the screen correctly and don't just scroll up since the cmd updates on Windows 10, it's worth a try on 7 or 8 to see if there are any differences.

@johanpedroo

I can't resolve this problem :/ anyone with this problem? How resolve?
image

@stefanivic
Contributor

@johanpedroo Check if you have VC++ Build Tools Technical Preview, also if you already have Visual Studio, just open it and install C++ tools trough it. Also make sure you are on python 2.7.x since node-gyp doesn't support python 3. After that just start all over and it should work.

@jcolesio
jcolesio commented Nov 9, 2016

:( still experiencing issues with bash.exe

When I start hyperterm from cygwin, then call bash, I dont get that highlighting issues.

Ideally would like to use WSL bash.exe instead.

Sooooo close yet soo far.

@matheuss
Collaborator
matheuss commented Nov 10, 2016 edited

I believe this work achieved a state that's acceptable to live on master, so I'm merging it!
The major issues are solved – Hyper now works on Windows! Also, big improvements were made in the Linux version

HUGE thanks to everyone who contributed here! It was amazing to receive that amount of feedback 🙌

Regarding arrow keys/history on bash: it's upstream as pointed out by @Tyriar 😔 See here for more info: Microsoft/BashOnWindows#111

Now I'll address everything that was reported/suggested here 😄


@factormystic:

Maximizing by clicking the maximize button seems to be resizing the window to the size of the active display, but dragging the window still works and doesn't restore the window as it should

I spent some time looking into it and I found that window.isMaximized() doesn't work – at least on Ubuntu. To be honest, I don't remember if I tested it on Windows – but we chatted about it on [zeit.chat] and we decided to leave as it is for now – since we can't rely on the API. We'd love a Pull Request to fix that 😄

Snap actions don't work

I researched about it and found almost nothing 😔 Since it's not a major issue: PRs are more than welcome 😄

minimizing doesn't animate like normal windows

Again, found nothing about it. I'm pretty sure it's upstream and there's nothing we can do about it apart from opening an issue on electron/electron 😕


@paulcbetts:

You need to handle --squirrel-install and friends, or else you won't get a shortcut

Thank you! It was fixed on 24518b7

If you set your shell to Windows-on-Linux bash, history doesn't work (i.e. type a command hit enter, then hit up to see it again, it doesn't work)

It's upstream 😕 See Microsoft/BashOnWindows#111 🙌

The default font list doesn't include any Windows fonts

cc @CodeTheory @rauchg

QuickEdit doesn't work

Since it's not a major issue, I'm leaving it available for an Issue/PR 😄

No context menu on right-click

We don't have it on Windows and Linux – so I don't think we'll have it for now on Windows 😅 But it might be useful (on all platforms) – so feel free to open an Issue! (electron-context-menu might be useful 😄)


@fhelwanger:

It would be nice to have an option on Windows explorer context menu to "Open Hyper here"

Agreed! It could be very useful on Mac and Linux too. I researched on how they do it on Windows and found this. Might be useful. PRs/issues are more than welcome! 😄


@Tyriar:

Thank you for your amazing work on pty.js! Without it we wouldn't have Windows support 🙌
We are aware of the issues – @rauchg gave me a 💯 to use your fork – we'll eveolve together with [Microsoft/vscode]


matthewp:

Paste doesn't work most of the time. I've seen it work some times, but can't figure out a pattern to get it to work. Copy seems to work fine, but that's not used as much (for me at least).

This is not related to Windows – it's related to Hyper. Will be fixed soon! 🙌


@madcampos:

Characters like '"~ get duplicated when inserted in the terminal [...] The contents don't update properly when the window is resized [...] Sometimes when the window is maximized than unmaximized the last line gets cut [...]

Can't reproduce 😰

Some characters are rendered as � (replacement character) [...] Line height [...] Some emojis don't show [...]

Both are not specific to Windows. Will be fixed soon! 😄


@jcolesio:

All of the text seems to be highlighted gray.

Can't reproduce 😰 It's probably something on your setup/env 😕


@jahe:

Closing one of multiple hyper windows causes every hyper window to close instead of just the one being closed

I noticed this during development and forgot to fix – thanks! Will fix it tomorrow before merging. Fixed on d76f6bd 😄

Decreasing the hyper window width and increasing it again causes the current working directory to be displayed cut

I believe this is not related to Windows – we have it on Mac and Linux too 😕


@Specro and @jahe:

Regarding the window/tab title: thanks for reporting! Turns out that cmd.exe likes to report the tab/window title as ' ' 😕 I added a workaround/fix here: 0250aea 😄


@flybayer:

We need a config option for swapping the location of the hamburger menu and window controls [...]

AMAZING suggestion, thank you! Implemented it on 1867ba8 😄

We need a config option for hiding the custom Hyper menu bar when fullscreen

I decided to leave this for later – would love a issue/PR!

Something is goofy with the Hyper custom menu elements [...] due to the size of the click area [...]

Thank you again! Fixed on 84993c9 🙌


@apiep:

Tab / Topbar feedback [...]

We discussed this before on zeit.chat and we were not able to find a better solution other than the current one 😕 So I decided to leave this for later – would love an issue/PR! 🙌


@Specro:

I'm interested if there will be someway to change to elevated prompt

I'm not sure how it works on Windows – maybe right clicking Hyper and run as admin is enough? 🤔

cls doesn't clear the screen correctly [...]

Can reproduce; no clue on how to fix 😅

@Tyriar
Contributor
Tyriar commented Nov 10, 2016

@matheuss great news 😄 FYI I enabled issues on https://github.com/Tyriar/pty.js and am working on upgrading winpty and investigating other Windows issues during November/December. I will likely change the name or the repo and publish the module to npm after some improvements are made.

@matheuss
Collaborator

Also, forgot to share:
Regarding the keyboard shortcuts, like ctrl+n, ctrl+t etc: I'll send a PR later today to fix the i18n stuff – that is, we'll be able to type any character with any keyboard layout 😄 Such fix involves a good rewrite in the intergration with hterm and how focus works, so I'll leave the fix for ctrl+t etc for that PR 😄

@@ -236,7 +236,7 @@ function install(fn) {
env.npm_config_target = '1.3.0';
env.npm_config_disturl = 'https://atom.io/download/atom-shell';
/* eslint-enable camelcase */
- exec('npm prune; npm install --production', {
+ exec('npm prune && npm install --production', {
@albinekb
albinekb Nov 10, 2016 Collaborator

This won't work with fish shell 🤔

@matheuss
matheuss Nov 10, 2016 Collaborator

and ; don't work on Windows 😩

@albinekb
albinekb Nov 10, 2016 Collaborator

maybe add this as a script in package.json?, then && works (even in fish)

@albinekb
albinekb Nov 10, 2016 Collaborator

or run them with .then after each other

exec('npm prune').then(() => exec('npm install'))
@fearphage
fearphage Nov 11, 2016 Contributor

FYI, you wouldn't have to use && in package.json.

"pretarget": "npm prune",
"target": "npm install",
return (<header
className={css('header', isMac && 'headerRounded')}
onClick={this.handleHeaderClick}
onMouseDown={this.handleHeaderMouseDown}
>
+ {
+ !isMac &&
@albinekb
albinekb Nov 10, 2016 Collaborator

This looks a bit messy, but i guess it works. Maybe break the different cases to new stateless components?

@matheuss
matheuss Nov 10, 2016 Collaborator

Hmm, sounds like a good idea, but I'm not sure how to execute it 🤔

It'd be something like<HeaderMac />?

@albinekb

Overall great job!

Some minor things (regarding compatibility with fish shell) and some code-styling issues (huge block of if-cases inside JSX), otherwise nothing to complain about, and again great job 🎉

@jcolesio

I wonder if I'm having the highlighting issue due to me using wsltty for the bash console.

matheuss and others added some commits Oct 27, 2016
@matheuss matheuss `child_pty` => `pty.js` 3384442
@matheuss matheuss Create a frameless window on Windows and Linux 3230ce4
@matheuss matheuss Add a brand new UI for Linux and Windows 💅 f8a8da6
@matheuss matheuss [Windows] Fix plugin installation 0a35ddc
@matheuss matheuss [Windows] Fix the `build` script 541edf1
@matheuss matheuss [Windows] Add a bigger `icon.ico` 3bf5a83
@matheuss matheuss [Mac] Add `WebKitAppRegion: drag` when running on macOS dfc6876
@matheuss matheuss Fix code style 🤔 4bf6797
@matheuss matheuss Add `appveyor.yml` 3030b13
@matheuss matheuss Fix code style (again) 4fd3275
@matheuss matheuss [Windows] Fix AppVeyor's `install` script 17084ff
@matheuss matheuss [Windows] Try a new AppVeyor config 0e3025b
@matheuss matheuss [Windows] Set the binary path so Spectron can run the tests 28d15df
@matheuss matheuss [Windows] Try to build on x64 0ff0d1b
@matheuss matheuss Try again to build on x64 a31a20f
@matheuss matheuss Try one more time 😩 d46a54d
@matheuss matheuss Throw an error to indicate that `pty.js` was built incorrectly 99bb5e0
@matheuss matheuss [Win/Linux] Add `display: hidden` to <Tabs /> if tabs.length === 1 b9f945f
@matheuss matheuss [Win/Linux] Reorganize SVGs – via @CodeTheory a221aad
@matheuss matheuss [Win/Linux] Fix the hamburger menu height 5dae33f
@matheuss matheuss Make the SVGs look better with `shape-rendering: crispEdges;` f3314bb
@matheuss matheuss [Win/Linux] Add config options for the window controls and the 🍔 menu 325b90b
@matheuss matheuss Add `electron-squirrel-startup` dependency 316831c
@matheuss matheuss [Win] Handle Squirrel commands 117410f
@matheuss matheuss [Win/Linux] Fix default color for the 🍔 and window controls – via @Co… 8e7ef2c
@matheuss matheuss [Win/Linux] Add some padding - via @CodeTheory 8b944fa
@matheuss matheuss [Win/Linux] Add hover states – via @CodeTheory 82bd606
@matheuss matheuss [Win] Fix empty window/tab titles 4055924
@stefanivic @matheuss stefanivic [Win] Fix opening Preferences (#978)
* [Win] Fix opening Preferences

* Update ui.js

* Update ui.js

* Enhance messages and default editor
285b884
@matheuss matheuss [Win] Add dependency instructions to the README.md [skip ci] efe582f
@matheuss matheuss Fix code style 8d68618
@matheuss matheuss [Win/Linux] Check the number of open windows before quitting the app
9e4bc96
@madcampos

After update from commit 488e1e8 I'm getting the spawn is not a function error plus some build errors.

@vors
Contributor
vors commented Nov 11, 2016

First of all 🎉
FANTASTIC!

I'm primarily interested in using hyper with powershell on windows.
Here is what I found so far

Copy-paste

I found that Ctrl+Shift+C / Ctrl+Shift+V works and it's awesome.
PowerShell has it's own way to provide copy-paste with PSReadLine.
The handlers logic is implemented in ReadLine. Ctrl+C doesn't work and produces ^C entry, but Ctrl+V works just fine. Not sure what's going on, but it would be sweet to make Ctrl+C work as well.

Crashes

When I switch active windows from hyper and wait for some time, I'm getting a reproducible crash

image

[Window Title]
Error

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
Error: EPERM: operation not permitted, lstat 'C:\Users\sevoroby\AppData\Local\Temp\notif1161010-13440-14fc7xb.ogn6gmygb9.jpg'
    at Error (native)
    at fs.lstatSync (fs.js:982:18)
    at Object.fs.lstatSync (ELECTRON_ASAR.js:249:16)
    at Gaze._addToWatched (F:\dev\hyper\app\node_modules\gaze\lib\gaze.js:292:14)
    at Gaze._internalAdd (F:\dev\hyper\app\node_modules\gaze\lib\gaze.js:206:10)
    at F:\dev\hyper\app\node_modules\gaze\lib\gaze.js:419:16
    at Array.forEach (native)
    at F:\dev\hyper\app\node_modules\gaze\lib\gaze.js:415:12
    at FSReqWrap.oncomplete (fs.js:123:15)

[OK]

Hyper vs Cmder

Conemu and Cmder been on windows for a while, but I didn't use them.
The main reason not to use them was that they slow down native executables. From what I heard, they inject intercept code to do scrapping of stdout and stderr and it adds overhead to all processes.
It slows down my builds about x2 times.

I created a simple one-liner to test it out and I found that hyper doesn't have this overhead problem!
Script that I used:

1..200 | % { perl -e 1 }

Results

Terminal Time (sec)
From powershell.exe: 4.51
cmder 8.29
hyper 4.26
@levrik
Contributor
levrik commented Nov 11, 2016 edited

I saw on the GIF by @Specro that the scrollbar seems not to have a custom style fitting the style of Hyper. The default Windows scrollbar destroys the look and feel a bit.

@stefanivic
Contributor

@levrik I've made an update to the scrollbars. Will push later in the day.

@levrik
Contributor
levrik commented Nov 11, 2016 edited

@stefanivic This looks really nice :o

@matheuss matheuss merged commit 9c90e19 into master Nov 11, 2016

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@matheuss
Collaborator

🎉 🎉 🎉 🎉 🎉 🎉

@matheuss
Collaborator
matheuss commented Nov 11, 2016 edited

I'll leave the branch alive for a while; will delete it when we're comfortable with everything.

Thanks again to everyone that contributed! 😄


@madcampos That commit changed nothing related to the build step, nor pty.js 😰


@vors
Amazing to know that we're that fast ☺️
Regarding that exception: I can't reproduce 😰
Regarding copy/paste: I'll introduce a PR very soon that will fix a lot of things related to keyboard issues – including keymaps 😄

@vors
Contributor
vors commented Nov 11, 2016

@matheuss I don't think that hyper+Powershell can be faster then native host for Powershell, but overhead seems negligible and it's impressive.

@Tyriar Tyriar referenced this pull request in Microsoft/vscode Nov 11, 2016
Open

Figure out what we're going to do with pty.js #13625

@vors
Contributor
vors commented Nov 12, 2016

@matheuss actually my statement about reproducible crash was wrong. I got it repro twice and could not repro it anymore as well.

@levrik
Contributor
levrik commented Nov 12, 2016

@factormystic That the snap feature of windows is not working and the minimize/restore animations are not there is caused by the transparant setting set on the window. More information here: http://electron.atom.io/docs/api/frameless-window/#transparent-window

@aleksijohansson

Really looking forward to this getting released!

@jasonmit
jasonmit commented Nov 23, 2016 edited

@jcolesio I also ran into this. The fix was to delete HKEY_CURRENT_USER\Console in the registry (likely only need to focus on deleting everything relating to colors).

But the core issue is the color palette at the system level is partially leaking into hyper. Should I file a bug for this @matheuss and friends?

Great work by the way :)

@jcolesio
jcolesio commented Nov 23, 2016 edited

@jasonmit You da man!!!!!!!! worked !

all we need is the arrow keys to register ;)

@jasonmit

@jcolesio Microsoft/BashOnWindows#111 looks to be the source of the the arrow key issue

@DanielPintilei
DanielPintilei commented Nov 24, 2016 edited

transparent: false BrowserWindow default would be nice; With transparent: true the window flickers sometimes on win.show() + there is no minimize/restore animation

@brighthero

When will there be a release windows version?

@ppot
Collaborator
ppot commented Nov 27, 2016 edited

In version 1.0.0. Likely coming in the next couple of weeks. cc/ @matheuss

@CodeTheory CodeTheory deleted the feature/windows-linux branch Nov 27, 2016
@howdoicomputer

Oh my God, this is amazing. As a heavy user of cmder, I can't be happier that terminal innovation is coming to Windows.

@thekalinga

Its not working on Ubuntu 14.04.

  1. Ctrl+A used to take me to the first character in the terminal before
    => Now it does all text in the window like a browser does

  2. Select text & try right clicking/pressing Ctrl+C, the selection is gone.
    => Text cannot be copied

@ppot
Collaborator
ppot commented Dec 10, 2016

@thekalinga 2. On windows you need to use : ctrl+shift+c for copy.
see : https://github.com/zeit/hyper/blob/master/app/accelerators.js
-> Right clicking not implemented right now.

  1. ctrl+A is used to selectAll like any linux terminal.
    -> First character on the terminal top or bottom.
@plessbd
plessbd commented Dec 12, 2016

@ppot

ctrl+A is used to selectAll like any linux terminal.
-> First character on the terminal top or bottom.

I believe most terminals ctrl+a moves to the beginning of the line and ctrl+e moves to the end of a line

see:
http://ss64.com/osx/syntax-bashkeyboard.html
http://lifehacker.com/5743814/become-a-command-line-ninja-with-these-time-saving-shortcuts
http://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/

@trodrigues

I just landed here looking for info on how to run Hyper with Bash on windows and found this comment by @Tyriar.

I wonder if there's a good place to document this to prevent someone getting so lost in the future. I don't see an FAQ section in the website.

Happy to provide a PR for this but wondering where the best place is.

@webframp

As mentioned by @plessbd:

@ppot
ctrl+A is used to selectAll like any linux terminal.
-> First character on the terminal top or bottom.
I believe most terminals ctrl+a moves to the beginning of the line and ctrl+e moves to the end of a line

It seems like a bad idea to override any gnu readline default keybindings without some way for the user to disable as the majority of shells (bash, zsh, fish) will implement basic readline bindings by default. I definitely prefer ctrl+a to move to the start of the line, not select all.

@ppot
Collaborator
ppot commented Dec 13, 2016

@webframp cmd+a is selectAll in macOS. ctrl+a is also true for what you are saying. The key-mapping need to be changed.

@ppot
Collaborator
ppot commented Dec 15, 2016

@webframp hterm interpret those actions as: ctrl+a === ctrl+shit+a and ctrl+e === ctrl+shit+e

@webframp

Thanks @ppot, ctrl+shift+a if not already taken would make sense as select-all and still preserves ctrl+a start of line behavior

@lasermarty

Any news on 1.0.0?

@fhelwanger

It's already released, 1.1.0 is the latest version: https://github.com/zeit/hyper/releases/tag/1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment