mirror of
https://github.com/Eugeny/tabby.git
synced 2025-01-07 11:19:24 +03:00
commit
8cef4e5cf9
@ -7,6 +7,7 @@ import { BaseTerminalTabComponent } from 'terminus-terminal'
|
|||||||
import { SSHService } from '../services/ssh.service'
|
import { SSHService } from '../services/ssh.service'
|
||||||
import { SSHConnection, SSHSession } from '../api'
|
import { SSHConnection, SSHSession } from '../api'
|
||||||
import { SSHPortForwardingModalComponent } from './sshPortForwardingModal.component'
|
import { SSHPortForwardingModalComponent } from './sshPortForwardingModal.component'
|
||||||
|
import {Subscription} from "rxjs";
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
@ -20,12 +21,28 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
ssh: SSHService
|
ssh: SSHService
|
||||||
session: SSHSession
|
session: SSHSession
|
||||||
private ngbModal: NgbModal
|
private ngbModal: NgbModal
|
||||||
|
private homeEndSubscription: Subscription
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.ngbModal = this.injector.get<NgbModal>(NgbModal)
|
this.ngbModal = this.injector.get<NgbModal>(NgbModal)
|
||||||
|
|
||||||
this.logger = this.log.create('terminalTab')
|
this.logger = this.log.create('terminalTab')
|
||||||
this.ssh = this.injector.get(SSHService)
|
this.ssh = this.injector.get(SSHService)
|
||||||
|
|
||||||
|
this.homeEndSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
|
||||||
|
if (!this.hasFocus) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
switch (hotkey) {
|
||||||
|
case 'home':
|
||||||
|
this.sendInput('\x1b[H' )
|
||||||
|
break
|
||||||
|
case 'end':
|
||||||
|
this.sendInput('\x1b[F' )
|
||||||
|
break
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
this.frontendReady$.pipe(first()).subscribe(() => {
|
this.frontendReady$.pipe(first()).subscribe(() => {
|
||||||
this.initializeSession()
|
this.initializeSession()
|
||||||
})
|
})
|
||||||
@ -92,4 +109,9 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
reconnect () {
|
reconnect () {
|
||||||
this.initializeSession()
|
this.initializeSession()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnDestroy () {
|
||||||
|
this.homeEndSubscription.unsubscribe()
|
||||||
|
super.ngOnDestroy()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user