From 76eff2448436930935dcd561e8b74ea18b9321d8 Mon Sep 17 00:00:00 2001 From: Andrea Maugars Date: Thu, 3 Oct 2019 21:03:29 +0200 Subject: [PATCH] Document that plugins can require Electron --- PLUGINS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index a7ba20ce..98cbb4ca 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -190,6 +190,17 @@ exports.decorateTerm = (Term, { React, notify }) => { } ``` +### Require Electron +Hyper doesn't provide a reference to electron. However plugins can directly require electron. + +```js +const electron = require('electron') +// or +const { dialog, Menu } = require('electron') +``` + +This is needed in order to allow show/hide to have proper return of focus. + ## Hyper v2 breaking changes Hyper v2 uses `xterm.js` instead of `hterm`. It means that PTY output renders now in a canvas element, not with a hackable DOM structure. For example, plugins can't use TermCSS in order to modify text or link styles anymore. It is now required to use available configuration params that are passed down to `xterm.js`.