mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 21:58:39 -09:00
hyperterm: add ctrl+c for closing <webview> instead of cmd+w (#2)
This commit is contained in:
parent
8b025d8861
commit
09c85e8069
1 changed files with 11 additions and 9 deletions
|
|
@ -103,16 +103,16 @@ export default class HyperTerm extends Component {
|
||||||
closeTab () {
|
closeTab () {
|
||||||
if (this.state.sessions.length) {
|
if (this.state.sessions.length) {
|
||||||
const uid = this.state.sessions[this.state.active];
|
const uid = this.state.sessions[this.state.active];
|
||||||
|
this.rpc.emit('exit', { uid });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.state.urls[uid]) {
|
closeBrowser () {
|
||||||
// if we have a url loaded, closing a tab
|
const uid = this.state.sessions[this.state.active];
|
||||||
// instead closes the url
|
if (this.state.urls[uid]) {
|
||||||
const urls = Object.assign({}, this.state.urls);
|
const urls = Object.assign({}, this.state.urls);
|
||||||
delete urls[uid];
|
delete urls[uid];
|
||||||
this.setState({ urls });
|
this.setState({ urls });
|
||||||
} else {
|
|
||||||
this.rpc.emit('exit', { uid });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -225,6 +225,8 @@ export default class HyperTerm extends Component {
|
||||||
Mousetrap.bind('command+8', this.moveTo.bind(this, 7));
|
Mousetrap.bind('command+8', this.moveTo.bind(this, 7));
|
||||||
Mousetrap.bind('command+9', this.moveTo.bind(this, 8));
|
Mousetrap.bind('command+9', this.moveTo.bind(this, 8));
|
||||||
|
|
||||||
|
Mousetrap.bind('ctrl+c', this.closeBrowser.bind(this));
|
||||||
|
|
||||||
Mousetrap.bind('command+shift+left', this.moveLeft);
|
Mousetrap.bind('command+shift+left', this.moveLeft);
|
||||||
Mousetrap.bind('command+shift+right', this.moveRight);
|
Mousetrap.bind('command+shift+right', this.moveRight);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue