diff --git a/app/index.js b/app/index.js index df1e64fa..f7b3acac 100644 --- a/app/index.js +++ b/app/index.js @@ -113,9 +113,9 @@ app.on('ready', () => installDevExtensions(isDev).then(() => { backgroundColor: toElectronBackgroundColor(cfg.backgroundColor || '#000'), transparent: true, icon: resolve(__dirname, 'static/icon.png'), - // we only want to show when the prompt - // is ready for user input - show: process.env.HYPERTERM_DEBUG || isDev, + // we only want to show when the prompt is ready for user input + // HYPERTERM_DEBUG for backwards compatibility with hyperterm + show: process.env.HYPER_DEBUG || process.env.HYPERTERM_DEBUG || isDev, x: startX, y: startY }; diff --git a/app/plugins.js b/app/plugins.js index fa7bd2c2..9d39df47 100644 --- a/app/plugins.js +++ b/app/plugins.js @@ -21,7 +21,8 @@ const localPath = resolve(homedir(), '.hyper_plugins', 'local'); const availableExtensions = new Set([ 'onApp', 'onWindow', 'onUnload', 'middleware', 'reduceUI', 'reduceSessions', 'decorateMenu', - 'decorateTerm', 'decorateHyperTerm', 'decorateTab', + 'decorateTerm', 'decorateHyper', 'decorateTab', + 'decorateHyperTerm', // for backwards compatibility with hyperterm 'decorateNotification', 'decorateNotifications', 'decorateTabs', 'decorateConfig', 'decorateEnv' ]); diff --git a/lib/containers/hyperterm.js b/lib/containers/hyper.js similarity index 96% rename from lib/containers/hyperterm.js rename to lib/containers/hyper.js index 59eda255..f1e009c4 100644 --- a/lib/containers/hyperterm.js +++ b/lib/containers/hyper.js @@ -13,7 +13,7 @@ import NotificationsContainer from './notifications'; const isMac = /Mac/.test(navigator.userAgent); -class HyperTerm extends Component { +class Hyper extends Component { constructor(props) { super(props); this.handleFocusActive = this.handleFocusActive.bind(this); @@ -132,7 +132,7 @@ class HyperTerm extends Component { } } -const HyperTermContainer = connect( +const HyperContainer = connect( state => { return { isMac, @@ -159,6 +159,6 @@ const HyperTermContainer = connect( }, null, {withRef: true} -)(HyperTerm, 'HyperTerm'); +)(Hyper, 'Hyper'); -export default HyperTermContainer; +export default HyperContainer; diff --git a/lib/hterm.js b/lib/hterm.js index 565fce99..7194bd4e 100644 --- a/lib/hterm.js +++ b/lib/hterm.js @@ -17,7 +17,7 @@ const oldMouse = hterm.Terminal.prototype.onMouse_; hterm.Terminal.prototype.onMouse_ = function (e) { if (e.type === 'dblclick') { selection.extend(this); - console.log('[hyperterm+hterm] ignore double click'); + console.log('[hyper+hterm] ignore double click'); return; } return oldMouse.call(this, e); @@ -37,7 +37,7 @@ hterm.Terminal.prototype.copySelectionToClipboard = function () { }; // passthrough all the commands that are meant to control -// hyperterm and not the terminal itself +// hyper and not the terminal itself const oldKeyDown = hterm.Keyboard.prototype.onKeyDown_; hterm.Keyboard.prototype.onKeyDown_ = function (e) { const modifierKeysConf = this.terminal.modifierKeys; diff --git a/lib/index.js b/lib/index.js index 9c81f58a..1ee1bb4f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -14,7 +14,7 @@ import * as sessionActions from './actions/sessions'; import * as termGroupActions from './actions/term-groups'; import {addNotificationMessage} from './actions/notifications'; import {loadConfig, reloadConfig} from './actions/config'; -import HyperTermContainer from './containers/hyperterm'; +import HyperContainer from './containers/hyper'; import configureStore from './store/configure-store'; // Disable pinch zoom @@ -130,7 +130,7 @@ rpc.on('add notification', ({text, url, dismissable}) => { const app = render( - + , document.getElementById('mount') ); diff --git a/lib/utils/plugins.js b/lib/utils/plugins.js index 776d6226..a31db75f 100644 --- a/lib/utils/plugins.js +++ b/lib/utils/plugins.js @@ -66,7 +66,7 @@ const loadModules = () => { connectors = { Terms: {state: [], dispatch: []}, Header: {state: [], dispatch: []}, - HyperTerm: {state: [], dispatch: []}, + Hyper: {state: [], dispatch: []}, Notifications: {state: [], dispatch: []} }; uiReducers = []; @@ -99,6 +99,18 @@ const loadModules = () => { } } + // mapHyperTermState mapping for backwards compatibility with hyperterm + if (mod.mapHyperTermState) { + mod.mapHyperState = mod.mapHyperTermState; + console.error('mapHyperTermState is deprecated. Use mapHyperState instead.'); + } + + // mapHyperTermDispatch mapping for backwards compatibility with hyperterm + if (mod.mapHyperTermDispatch) { + mod.mapHyperDispatch = mod.mapHyperTermDispatch; + console.error('mapHyperTermDispatch is deprecated. Use mapHyperDispatch instead.'); + } + if (mod.middleware) { middlewares.push(mod.middleware); } @@ -127,12 +139,12 @@ const loadModules = () => { connectors.Header.dispatch.push(mod.mapHeaderDispatch); } - if (mod.mapHyperTermState) { - connectors.HyperTerm.state.push(mod.mapHyperTermState); + if (mod.mapHyperState) { + connectors.Hyper.state.push(mod.mapHyperState); } - if (mod.mapHyperTermDispatch) { - connectors.HyperTerm.dispatch.push(mod.mapHyperTermDispatch); + if (mod.mapHyperDispatch) { + connectors.Hyper.dispatch.push(mod.mapHyperDispatch); } if (mod.mapNotificationsState) {