mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -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 () {
|
||||
if (this.state.sessions.length) {
|
||||
const uid = this.state.sessions[this.state.active];
|
||||
this.rpc.emit('exit', { uid });
|
||||
}
|
||||
}
|
||||
|
||||
if (this.state.urls[uid]) {
|
||||
// if we have a url loaded, closing a tab
|
||||
// instead closes the url
|
||||
const urls = Object.assign({}, this.state.urls);
|
||||
delete urls[uid];
|
||||
this.setState({ urls });
|
||||
} else {
|
||||
this.rpc.emit('exit', { uid });
|
||||
}
|
||||
closeBrowser () {
|
||||
const uid = this.state.sessions[this.state.active];
|
||||
if (this.state.urls[uid]) {
|
||||
const urls = Object.assign({}, this.state.urls);
|
||||
delete urls[uid];
|
||||
this.setState({ urls });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -225,6 +225,8 @@ export default class HyperTerm extends Component {
|
|||
Mousetrap.bind('command+8', this.moveTo.bind(this, 7));
|
||||
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+right', this.moveRight);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue