Hyper: Broken text after system hibernation

Created on 19 Apr 2018  路  29Comments  路  Source: vercel/hyper

I have a problem after returning from hibernation of my Ubuntu linux system:
After I "wake up" from hibernation Hyper seems to have crashed or something. :confused:
It is still responsive but the text output is broken. Same thing for multible tabs. See below:

peek 2018-04-19 10-37

It looks to me like a problem with electron on linux but I don't have this problem with any other electron app.

  • system: Ubuntu 16.04 LTS 64bit
  • hyper: Hyper 2.0.0-canary.18 (canary)
help wanted Bug Linux

Most helpful comment

BTW, zooming in and out fixes the issue (possibly a workaround?)...

peek 2018-05-07 15-38

All 29 comments

Seems like the Character Atlas map (in GPU memory) is gone and it didn't regenerate, I don't know why macOS and Windows does not have these issues 馃 Do you have multiple GPUs?

Do you have multiple GPUs?

Not that I know of. I have a GeForce GTX 760/PCIe/SSE2
But I use multiple displays.

Ok, could you try using VS Code and the built in terminal in there, hibernate and see if you get the same issue? https://code.visualstudio.com/

We're using the same library (xterm) that has an in memory pre-baked map of all characters, if the issue is also in VS Code, we know it's an issue with xterm and we need to investigate how to detect that the map is gone from memory and re-generate, if not, we have done something in hyper that makes this happen.

Thanks and sorry for the inconvenience.

Ok, could you try using VS Code and the built in terminal, hibernate and see if you get the same issue?

I could not reproduce this problem with Visual Studio Code. After a hibernation cycle the integrated terminal is still open and working.

Thanks and sorry for the inconvenience.

Not a problem at all! Please let me know If I can help in any way.

I can not reproduce this issue on another System also with Ubuntu 16.04 LTS 64bit and multible screens.
I suspect it has something to do with the specific graphics-card driver!?
_Please consider this issue a low priority and feel free to close it at any time._

BTW, zooming in and out fixes the issue (possibly a workaround?)...

peek 2018-05-07 15-38

It seems like it's a color issue. Current color (in my case #fff) becomes black. Changing it for example to white or any other fixes it.

peek 2018-05-07 15-44

I don't think it's caused by xterm. Check out Atom and install minimap package. Hibernate, wake up and tada:

peek 2018-05-08 16-25

Zooming in & out confirms that the issue is with xterm CharAtlas, it's basically a big spritemap in-memory with the most common combinations of characters and colors, to speed up rendering in the canvas.

It must be that after hibernation in linux with some combinations loses/corrupts this memory? I have no idea how to fix it though, but one workaround would be to re-generate the CharAtlas after sleep? 馃

It must be that after hibernation in linux with some combinations loses/corrupts this memory?

Ubuntu is good at losing memory, that's true.

one workaround would be to re-generate the CharAtlas after sleep

That seems to be pretty good solution. It'd amazing if this could possibly come as a experimental feature.

Ubuntu is good at losing memory, that's true.

Here's a proof:

peek 2018-05-08 20-16

That seems to be pretty good solution. It'd amazing if this could possibly come as a experimental feature.

I think we could do it as a plugin? And this close this issue with that since this is pretty rare and the plugin would solve it, thoughts?

I think we could do it as a plugin?

Definitely yes. The easiest way to fix this issue.

And this close this issue with that since this is pretty rare and the plugin would solve it, thoughts?

I agree. I'm sure that's Ubuntu's fault... Just look at the GIF above. Sometimes tooltips are noisy too. But yeah, regenerating CharAtlas is the best workaround we have come up with :smiley:

  • [x] I am on the latest Hyper.app version
  • [x] I have searched the issues of this repo and believe that this is not a duplicate

Issue

when i suspend ubuntu and start computer again, hyper screen is crash:

Repost above issue:
selection_001_09 50 16_16_05_2018

The problem just happen when i use NDIVIA binary driver:

selection_001_09 51 27_16_05_2018

All other programs have no problem but hyper.
I think the problem relate with Electron but i don't see the problem on Visual Studio Code.

I now also see this in vscode:
image
_(Image: vscode in the background, hyper in the foreground)_

I just saw the same problem on a canvas element in Chrome. Looks like this is a problem in chromium and therefore electron!?
image
_(Image a plotls.js chart broke after system hibernation)_

I think it's an issue with your graphics drivers/OS @mojoaxel, doesn't happen on every distro and not on macOS nor Windows.

This is obviously not an hyper issue. I'll close this here.

It might help to run your electron app with deactivated GPU support. e.g. code --disable-gpu

Yes but that will probably give horrible performance for canvas? @mojoaxel have you found any issue about this in electron we can link to?

Also I think it's possible to work around this if we want. The issue is that the atlas map is lost from GPU memory during hibirnation, so if we detect when the app comes back from hibirnation, we could make a plugin to fix this for users that experience this.

Plugin could be made that reloads the character atlas and draws the canvas again using xterm internals, I'm not sure how to do this but I'm sure it's possible.

I have experienced this problem with every electron app I've used, except, interestingly, Slack. But I have experienced it for at least a couple years. I can't find any issues submitted to Electron, Atom nor Chromium after a decent search attempt.

I do think @albinekb and @mojoaxel are right that this is something far upstream from Hyper, and might be tied to OS and/or drivers. I'm on Mint 18.3, currently using the NVIDIA driver 384.130, though I've also had the issue with Nouveau.

The problem is solved in Hyper and in Atom by simply doing something to re-render the text, like zooming or opening modal windows (like find-and-replace in Atom), and this is usually good enough for me.

I also suffer from the same thing, Ubuntu 18.04, Gnome 3.28.2, nvidia-driver-430 (also tested 390, 396, 415). Below is a sample of what I see.

I do want to point out that maybe theres some motivation to try to do something on the Hyper side to ease our pain, because while I also see this same kind of corruption in other Electron apps, Hyper is unique in that I can't get rid of it with resizing, etc... nor with restarting Gnome (Alt+F2 + r) which fixes all other apps except Hyper. Reload is the only thing that works. A simple plugin that does that automatically would be much appreciated! (I've already got a script automatically reloads Gnome, but Hyper remains the lone corrupted app otherwise)

out

Just a quick note to mention that I am also experiencing this problem. I'm seeing this running Hyper from Windows 10, then running bash. My machine has both Intel graphics as well as NVidia graphics (Dell XPS laptop).

btw. This bug is fixed in Ubuntu 19.10 and in 19.04 and 18.10 possibly too. I think this is due to new Gnome version

@SleepWalker What nvidia drivers are you using? What is your kelner version?

@szmarczak kernel 5.3.0-24-generic and no nvidia drivers currently :) I've forgot, that I've switched my notebook to the new one. If I'll find the time to upgrade my old laptop to the latest ubuntu, I'll re-check how does hyper work there.

@SleepWalker Then perhaps nouveau got fixed.

Its an nvidia chrome issue, https://askubuntu.com/questions/1273399/problems-with-chrome-browser-after-suspending-the-computer-on-ubuntu-20-04, is there a way to set chrome flags in hyper? enable-features=Vulkan seems to fix it for chrome browser.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

legomushroom picture legomushroom  路  3Comments

dbkaplun picture dbkaplun  路  3Comments

laur1s picture laur1s  路  3Comments

rauchg picture rauchg  路  3Comments

anthonyettinger picture anthonyettinger  路  3Comments