vercel / hyper

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

Add a way for plugins to add xterm addons #2903

Open chabou opened 6 years ago

chabou commented 6 years ago

xtermjs offers a way to enhance its API: https://xtermjs.org/docs/guides/using-addons/

We need to find a way to let plugins add some addons.

Proposal:

// Plugin side
import * as zmodem from 'xterm/lib/addons/zmodem/zmodem';

exports.getXtermAddons() {
  return zmodem // [zmodem] will work too
}

On Hyper side, we need to execute this method for all plugins (each time they've changed) to get all these addons and apply them with:

  Terminal.applyAddon(pluginAddon);
albinekb commented 6 years ago

Plugin idea: Make a plugin that can enable any xterm.js addon via hyper.js config