Merge branch 'master' into xterm
* master: (62 commits) 1.4.3 Disable ia32 linux releases (#2164) Fixed writing composed characters (#2158) Doc: Add yarn install to contribute instructions (#2117) Change "Close Session" shortcut on Linux/Windows (#2160) Notice for plugins (#2114) Updated dependencies to the latest version (#2146) 1.4.2 Reverted class names to as they were before (#2139) 1.4.1 AppVeyor environment variables are now on the platform (#2137) Brought back the icon for closing tabs (#2136) Brought back keymap documentation to the website (#2133) 1.4.0 Don't build on master, except for releases (#2132) Ensured that `async-retry` is added to the bundle (#2131) Ensure correct update channel is displayed in About window (#2130) Retry loading it if config doesn't exist in auto updater (#2129) Write contents of default config to hyper.js (#2128) Use a string for setting the update channel (#2127) ...
This commit is contained in:
commit
944f9d7e89
52 changed files with 129442 additions and 2306 deletions
|
|
@ -140,7 +140,7 @@ export function resizeSession(uid, cols, rows) {
|
|||
};
|
||||
}
|
||||
|
||||
export function sendSessionData(uid, data) {
|
||||
export function sendSessionData(uid, data, escaped) {
|
||||
return function (dispatch, getState) {
|
||||
dispatch({
|
||||
type: SESSION_USER_DATA,
|
||||
|
|
@ -148,7 +148,8 @@ export function sendSessionData(uid, data) {
|
|||
effect() {
|
||||
// If no uid is passed, data is sent to the active session.
|
||||
const targetUid = uid || getState().sessions.activeUid;
|
||||
rpc.emit('data', {uid: targetUid, data});
|
||||
|
||||
rpc.emit('data', {uid: targetUid, data, escaped});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@ export default class Header extends Component {
|
|||
const {hambMenu, winCtrls} = this.getWindowHeaderConfig();
|
||||
const left = winCtrls === 'left';
|
||||
const maxButtonHref = this.props.maximized ?
|
||||
'./dist/assets/icons.svg#restore-window' :
|
||||
'./dist/assets/icons.svg#maximize-window';
|
||||
'./renderer/assets/icons.svg#restore-window' :
|
||||
'./renderer/assets/icons.svg#maximize-window';
|
||||
|
||||
return (<header
|
||||
className={css('header', isMac && 'headerRounded')}
|
||||
|
|
@ -126,7 +126,7 @@ export default class Header extends Component {
|
|||
className={css('shape', (left && 'hamburgerMenuRight') || 'hamburgerMenuLeft')}
|
||||
onClick={this.handleHamburgerMenuClick}
|
||||
>
|
||||
<use xlinkHref="./dist/assets/icons.svg#hamburger-menu"/>
|
||||
<use xlinkHref="./renderer/assets/icons.svg#hamburger-menu"/>
|
||||
</svg>
|
||||
}
|
||||
<span className={css('appTitle')}>{title}</span>
|
||||
|
|
@ -137,7 +137,7 @@ export default class Header extends Component {
|
|||
className={css('shape', left && 'minimizeWindowLeft')}
|
||||
onClick={this.handleMinimizeClick}
|
||||
>
|
||||
<use xlinkHref="./dist/assets/icons.svg#minimize-window"/>
|
||||
<use xlinkHref="./renderer/assets/icons.svg#minimize-window"/>
|
||||
</svg>
|
||||
<svg
|
||||
className={css('shape', left && 'maximizeWindowLeft')}
|
||||
|
|
@ -149,7 +149,7 @@ export default class Header extends Component {
|
|||
className={css('shape', 'closeWindow', left && 'closeWindowLeft')}
|
||||
onClick={this.handleCloseClick}
|
||||
>
|
||||
<use xlinkHref="./dist/assets/icons.svg#close-window"/>
|
||||
<use xlinkHref="./renderer/assets/icons.svg#close-window"/>
|
||||
</svg>
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ export default class Notification extends Component {
|
|||
const {backgroundColor} = this.props;
|
||||
const opacity = this.state.dismissing ? 0 : 1;
|
||||
return (<div
|
||||
style={{opacity, backgroundColor}}
|
||||
ref={this.onElement}
|
||||
style={{opacity, backgroundColor}}
|
||||
className={css('indicator')}
|
||||
>
|
||||
{ this.props.customChildrenBefore }
|
||||
|
|
|
|||
|
|
@ -47,12 +47,17 @@ export default class SplitPane extends Component {
|
|||
onDrag(ev) {
|
||||
let {sizes} = this.props;
|
||||
let sizes_;
|
||||
|
||||
if (sizes) {
|
||||
sizes_ = [].concat(sizes);
|
||||
} else {
|
||||
const total = this.props.children.length;
|
||||
sizes = sizes_ = new Array(total).fill(1 / total);
|
||||
const count = new Array(total).fill(1 / total);
|
||||
|
||||
sizes = count;
|
||||
sizes_ = count;
|
||||
}
|
||||
|
||||
const i = this.paneIndex;
|
||||
const pos = ev[this.d3];
|
||||
const d = Math.abs(this.dragPanePosition - pos) / this.panesSize;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ export default class Tab extends Component {
|
|||
onClick={this.props.onClose}
|
||||
>
|
||||
<svg className={css('shape')}>
|
||||
<use xlinkHref="./dist/assets/icons.svg#close-tab"/>
|
||||
<use xlinkHref="./renderer/assets/icons.svg#close-tab"/>
|
||||
</svg>
|
||||
</i>
|
||||
{ this.props.customChildren }
|
||||
|
|
|
|||
|
|
@ -65,20 +65,22 @@ class Hyper extends Component {
|
|||
const borderWidth = isMac_ ? '' :
|
||||
`${maximized ? '0' : '1'}px`;
|
||||
|
||||
return (<div>
|
||||
<div
|
||||
style={{fontFamily: uiFontFamily, borderColor, borderWidth}}
|
||||
className={css('main', isMac_ && 'mainRounded')}
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
style={{fontFamily: uiFontFamily, borderColor, borderWidth}}
|
||||
className={css('main', isMac_ && 'mainRounded')}
|
||||
>
|
||||
<HeaderContainer/>
|
||||
<TermsContainer ref_={this.onTermsRef}/>
|
||||
{ this.props.customInnerChildren }
|
||||
</div>
|
||||
<HeaderContainer/>
|
||||
<TermsContainer ref_={this.onTermsRef}/>
|
||||
{ this.props.customInnerChildren }
|
||||
</div>
|
||||
|
||||
<NotificationsContainer/>
|
||||
<style dangerouslySetInnerHTML={{__html: customCSS}}/>
|
||||
{ this.props.customChildren }
|
||||
</div>);
|
||||
<NotificationsContainer/>
|
||||
<style dangerouslySetInnerHTML={{__html: customCSS}}/>
|
||||
{ this.props.customChildren }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
styles() {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ lib.wc.strWidth = function (str) {
|
|||
if (width < 0) {
|
||||
return -1;
|
||||
}
|
||||
rv += width * ((codePoint <= 0xffff) ? 1 : 2);
|
||||
rv += width * ((codePoint <= 0xFFFF) ? 1 : 2);
|
||||
}
|
||||
if (shouldCache) {
|
||||
cache[str] = rv;
|
||||
|
|
@ -256,7 +256,9 @@ hterm.Keyboard.prototype.onKeyDown_ = function (e) {
|
|||
];
|
||||
if (!clearBlacklist.includes(e.code.toLowerCase()) &&
|
||||
!clearBlacklist.includes(e.key.toLowerCase())) {
|
||||
selection.clear(this.terminal);
|
||||
// Since Electron 1.6.X, there is a race condition with character composition
|
||||
// if this selection clearing is made synchronously. See #2140.
|
||||
setTimeout(() => selection.clear(this.terminal), 0);
|
||||
}
|
||||
|
||||
// If the `hyperCaret` was removed on `selectAll`, we need to insert it back
|
||||
|
|
@ -449,7 +451,7 @@ lib.colors.hexToRGB = function (arg) {
|
|||
')';
|
||||
}
|
||||
|
||||
if (arg instanceof Array) {
|
||||
if (Array.isArray(arg)) {
|
||||
for (let i = 0; i < arg.length; i++) {
|
||||
arg[i] = convert(arg[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ rpc.on('session data', d => {
|
|||
}
|
||||
});
|
||||
|
||||
rpc.on('session data send', ({uid, data}) => {
|
||||
store_.dispatch(sessionActions.sendSessionData(uid, data));
|
||||
rpc.on('session data send', ({uid, data, escaped}) => {
|
||||
store_.dispatch(sessionActions.sendSessionData(uid, data, escaped));
|
||||
});
|
||||
|
||||
rpc.on('session exit', ({uid}) => {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,19 @@ const clearModulesCache = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const getPluginName = path => window.require('path').basename(path);
|
||||
const pathModule = window.require('path');
|
||||
|
||||
const getPluginName = path => pathModule.basename(path);
|
||||
|
||||
const getPluginVersion = path => {
|
||||
let version = null;
|
||||
try {
|
||||
version = window.require(pathModule.resolve(path, 'package.json')).version;
|
||||
} catch (err) {
|
||||
console.warn(`No package.json found in ${path}`);
|
||||
}
|
||||
return version;
|
||||
};
|
||||
|
||||
const loadModules = () => {
|
||||
console.log('(re)loading renderer plugins');
|
||||
|
|
@ -112,6 +124,7 @@ const loadModules = () => {
|
|||
.map(path => {
|
||||
let mod;
|
||||
const pluginName = getPluginName(path);
|
||||
const pluginVersion = getPluginVersion(path);
|
||||
|
||||
// window.require allows us to ensure this doesn't get
|
||||
// in the way of our build
|
||||
|
|
@ -126,6 +139,7 @@ const loadModules = () => {
|
|||
for (const i in mod) {
|
||||
if ({}.hasOwnProperty.call(mod, i)) {
|
||||
mod[i]._pluginName = pluginName;
|
||||
mod[i]._pluginVersion = pluginVersion;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -209,6 +223,8 @@ const loadModules = () => {
|
|||
mod.onRendererWindow(window);
|
||||
}
|
||||
|
||||
console.log(`Plugin ${pluginName} (${pluginVersion}) loaded.`);
|
||||
|
||||
return mod;
|
||||
})
|
||||
.filter(mod => Boolean(mod));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import path from 'path';
|
||||
import * as regex from './url-regex';
|
||||
|
||||
export default function isUrlCommand(shell, data) {
|
||||
const matcher = regex[shell]; // eslint-disable-line import/namespace
|
||||
const matcher = regex[path.parse(shell).name]; // eslint-disable-line import/namespace
|
||||
if (undefined === matcher || !data) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue