mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-15 08:59:58 +00:00
This commit is contained in:
parent
7b4e6e8f3a
commit
d0fe64355b
@ -161,7 +161,7 @@ export class SSHSession extends BaseSession {
|
||||
}
|
||||
})
|
||||
|
||||
this.shell.on('end', () => {
|
||||
this.shell.on('end', e => {
|
||||
this.logger.info('Shell session ended')
|
||||
if (this.open) {
|
||||
this.destroy()
|
||||
|
@ -19,20 +19,21 @@
|
||||
[(ngModel)]='connection.group',
|
||||
)
|
||||
|
||||
.form-group
|
||||
label Host
|
||||
input.form-control(
|
||||
type='text',
|
||||
[(ngModel)]='connection.host',
|
||||
)
|
||||
.d-flex
|
||||
.form-group
|
||||
label Host
|
||||
input.form-control(
|
||||
type='text',
|
||||
[(ngModel)]='connection.host',
|
||||
)
|
||||
|
||||
.form-group
|
||||
label Port
|
||||
input.form-control(
|
||||
type='number',
|
||||
placeholder='22',
|
||||
[(ngModel)]='connection.port',
|
||||
)
|
||||
.form-group
|
||||
label Port
|
||||
input.form-control(
|
||||
type='number',
|
||||
placeholder='22',
|
||||
[(ngModel)]='connection.port',
|
||||
)
|
||||
|
||||
.form-group
|
||||
label Username
|
||||
|
@ -6,9 +6,9 @@
|
||||
i.fas.fa-circle.text-danger.mr-2(*ngIf='!session.open')
|
||||
strong.mr-auto(*ngIf='session') {{session.connection.user}}@{{session.connection.host}}:{{session.connection.port}}
|
||||
|
||||
button.btn.btn-secondary.mr-2((click)='reconnect()', [class.btn-info]='!session.open')
|
||||
span Reconnect
|
||||
|
||||
button.btn.btn-secondary((click)='showPortForwarding()', *ngIf='session.open')
|
||||
i.fas.fa-plug
|
||||
span Ports
|
||||
|
||||
button.btn.btn-info((click)='reconnect()', *ngIf='!session.open')
|
||||
span Reconnect
|
||||
|
@ -95,6 +95,10 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
session.resize(this.size.columns, this.size.rows)
|
||||
})
|
||||
|
||||
session.destroyed$.subscribe(() => {
|
||||
this.write('\r\n' + colors.black.bgCyan(' SSH ') + ` ${session.connection.host}: session closed\r\n`)
|
||||
})
|
||||
|
||||
this.write('\r\n' + colors.black.bgCyan(' SSH ') + ` Connecting to ${session.connection.host}\r\n`)
|
||||
|
||||
const spinner = new Spinner({
|
||||
@ -149,8 +153,10 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
modal.session = this.session
|
||||
}
|
||||
|
||||
reconnect (): void {
|
||||
this.initializeSession()
|
||||
async reconnect (): Promise<void> {
|
||||
this.session?.destroy()
|
||||
await this.initializeSession()
|
||||
this.session.releaseInitialDataBuffer()
|
||||
}
|
||||
|
||||
async canClose (): Promise<boolean> {
|
||||
|
@ -474,7 +474,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
]
|
||||
}
|
||||
|
||||
protected attachSessionHandlers (): void {
|
||||
protected attachSessionHandlers (destroyOnSessionClose = false): void {
|
||||
// this.session.output$.bufferTime(10).subscribe((datas) => {
|
||||
this.session.output$.subscribe(data => {
|
||||
if (this.enablePassthrough) {
|
||||
@ -485,9 +485,11 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
}
|
||||
})
|
||||
|
||||
this.sessionCloseSubscription = this.session.closed$.subscribe(() => {
|
||||
this.frontend.destroy()
|
||||
this.destroy()
|
||||
})
|
||||
if (destroyOnSessionClose) {
|
||||
this.sessionCloseSubscription = this.session.closed$.subscribe(() => {
|
||||
this.frontend.destroy()
|
||||
this.destroy()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent {
|
||||
})
|
||||
)
|
||||
|
||||
this.attachSessionHandlers()
|
||||
this.attachSessionHandlers(true)
|
||||
}
|
||||
|
||||
async getRecoveryToken (): Promise<any> {
|
||||
|
@ -73,6 +73,8 @@ export abstract class BaseSession {
|
||||
this.open = false
|
||||
this.closed.next()
|
||||
this.destroyed.next()
|
||||
this.closed.complete()
|
||||
this.destroyed.complete()
|
||||
this.output.complete()
|
||||
this.binaryOutput.complete()
|
||||
await this.gracefullyKillProcess()
|
||||
|
Loading…
x
Reference in New Issue
Block a user