Hyper: decorateConfig not called?

Created on 26 Apr 2018  路  5Comments  路  Source: vercel/hyper

  • [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

  • OS version and name: Mac OS 10.13.2

  • Hyper.app version: 2.0.0
  • Link of a Gist with the contents of your .hyper.js: https://gist.github.com/Aaronius/8f9b91631fb0ff83b07750a4a3fbb03d
  • Relevant information from devtools N/A
  • The issue is reproducible in vanilla Hyper.app: Pertains to building a particular extension, but everything else is vanilla.

Issue

I'm trying to update the hyper-cat plugin to work with Hyper 2. Unfortunately, my decorateConfig method never gets called. Is this a known issue or am I missing something. I've tried narrowing it down by commenting everything else out, but it still doesn't get called. Here's my current work-in-progress that demonstrates the issue: https://github.com/Aaronius/hyper-cat/blob/89d734b146de09ce5cd7c11ee73318cd263914bd/index.js

decorateConfig should get called and therefore log the config to the console, but it never gets called.

Most helpful comment

BTW, my next somewhat related question will be: is there any way hyper-cat can toggle the xterm-text-layer canvas background opacity (on and off as the user types and stops typing)? The nyan must shine through in all its glory while the user is typing..

All 5 comments

BTW, my next somewhat related question will be: is there any way hyper-cat can toggle the xterm-text-layer canvas background opacity (on and off as the user types and stops typing)? The nyan must shine through in all its glory while the user is typing..

your console.log should be displayed where you typed yarn app. Because this function is executed on main thread, not on renderer.

you can toggle opacity by changing the background color (If background color is not opaque, xterm canvas background will be transparent). But changing it has a cost, regenerating char atlas, redraw etc...
I will suggest you to always set a 0.99 alpha color if your plugin is used with an opaque background color. The only downside is that it will disable subpixel antialiasing but I wonder if hyper-cat users do care 馃槢

Thanks @chabou, that helps a lot. I'm able to set the backgroundColor to transparent through decorateConfig, but what I'd really like to do is toggle it at runtime instead. In other woreds, I'd like the user to be able to define whatever background they normally prefer (using backgroundColor), and then at runtime when the user starts typing, I need to change their background with the nyan background, but that also requires me to, at runtime, set backgroundColor to transparent so that xterm-text-layer doesn't cover up the nyan background. Does that make sense? Thanks for your help.

@Aaronius To toggle the background-color at runtime, I think that you can use getTermProps API handler.

Thanks. I'll give it a go sometime. My original problem has been resolved, so I'm going to close this issue. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leo picture leo  路  3Comments

hxnt picture hxnt  路  3Comments

eoinmurray picture eoinmurray  路  3Comments

rauchg picture rauchg  路  3Comments

laur1s picture laur1s  路  3Comments