mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-27 14:59:57 +00:00
ref: implement recentInputs on baseTerminalTab
This commit is contained in:
parent
f423be1510
commit
6498c4f923
@ -47,10 +47,6 @@ export class SerialTabComponent extends BaseTerminalTabComponent<SerialProfile>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.frontendReady$.pipe(first()).subscribe(() => {
|
|
||||||
this.initializeSession()
|
|
||||||
})
|
|
||||||
|
|
||||||
super.ngOnInit()
|
super.ngOnInit()
|
||||||
|
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
@ -58,6 +54,11 @@ export class SerialTabComponent extends BaseTerminalTabComponent<SerialProfile>
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected onFrontendReady (): void {
|
||||||
|
this.initializeSession()
|
||||||
|
super.onFrontendReady()
|
||||||
|
}
|
||||||
|
|
||||||
async initializeSession () {
|
async initializeSession () {
|
||||||
const session = new SerialSession(this.injector, this.profile)
|
const session = new SerialSession(this.injector, this.profile)
|
||||||
this.setSession(session)
|
this.setSession(session)
|
||||||
|
@ -30,7 +30,6 @@ export class SSHTabComponent extends BaseTerminalTabComponent<SSHProfile> implem
|
|||||||
sftpPath = '/'
|
sftpPath = '/'
|
||||||
enableToolbar = true
|
enableToolbar = true
|
||||||
activeKIPrompt: KeyboardInteractivePrompt|null = null
|
activeKIPrompt: KeyboardInteractivePrompt|null = null
|
||||||
private recentInputs = ''
|
|
||||||
private reconnectOffered = false
|
private reconnectOffered = false
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
@ -71,17 +70,14 @@ export class SSHTabComponent extends BaseTerminalTabComponent<SSHProfile> implem
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.frontendReady$.pipe(first()).subscribe(() => {
|
|
||||||
this.initializeSession()
|
|
||||||
this.input$.subscribe(data => {
|
|
||||||
this.recentInputs += data
|
|
||||||
this.recentInputs = this.recentInputs.substring(this.recentInputs.length - 32)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
super.ngOnInit()
|
super.ngOnInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected onFrontendReady (): void {
|
||||||
|
this.initializeSession()
|
||||||
|
super.onFrontendReady()
|
||||||
|
}
|
||||||
|
|
||||||
async setupOneSession (injector: Injector, profile: SSHProfile, multiplex = true): Promise<SSHSession> {
|
async setupOneSession (injector: Injector, profile: SSHProfile, multiplex = true): Promise<SSHSession> {
|
||||||
let session = await this.sshMultiplexer.getSession(profile)
|
let session = await this.sshMultiplexer.getSession(profile)
|
||||||
if (!multiplex || !session || !profile.options.reuseSession) {
|
if (!multiplex || !session || !profile.options.reuseSession) {
|
||||||
|
@ -36,13 +36,14 @@ export class TelnetTabComponent extends BaseTerminalTabComponent<TelnetProfile>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.frontendReady$.pipe(first()).subscribe(() => {
|
|
||||||
this.initializeSession()
|
|
||||||
})
|
|
||||||
|
|
||||||
super.ngOnInit()
|
super.ngOnInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected onFrontendReady (): void {
|
||||||
|
this.initializeSession()
|
||||||
|
super.onFrontendReady()
|
||||||
|
}
|
||||||
|
|
||||||
protected attachSessionHandlers (): void {
|
protected attachSessionHandlers (): void {
|
||||||
const session = this.session!
|
const session = this.session!
|
||||||
this.attachSessionHandler(session.destroyed$, () => {
|
this.attachSessionHandler(session.destroyed$, () => {
|
||||||
|
@ -129,6 +129,7 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
|||||||
protected output = new Subject<string>()
|
protected output = new Subject<string>()
|
||||||
protected binaryOutput = new Subject<Buffer>()
|
protected binaryOutput = new Subject<Buffer>()
|
||||||
protected sessionChanged = new Subject<BaseSession|null>()
|
protected sessionChanged = new Subject<BaseSession|null>()
|
||||||
|
protected recentInputs = ''
|
||||||
private bellPlayer: HTMLAudioElement
|
private bellPlayer: HTMLAudioElement
|
||||||
private termContainerSubscriptions = new SubscriptionContainer()
|
private termContainerSubscriptions = new SubscriptionContainer()
|
||||||
private sessionHandlers = new SubscriptionContainer()
|
private sessionHandlers = new SubscriptionContainer()
|
||||||
@ -415,6 +416,11 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
|||||||
this.frontend!.write('\r\n\r\n')
|
this.frontend!.write('\r\n\r\n')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.input$.subscribe(data => {
|
||||||
|
this.recentInputs += data
|
||||||
|
this.recentInputs = this.recentInputs.substring(this.recentInputs.length - 32)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async buildContextMenu (): Promise<MenuItemOptions[]> {
|
async buildContextMenu (): Promise<MenuItemOptions[]> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user