1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-27 10:42:35 +03:00

ssh: use correct profile's login scripts - fixes #6064

This commit is contained in:
Eugene Pankov 2022-04-15 19:15:27 +02:00
parent 9c6acf99d0
commit 358a7563f6
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 3 additions and 4 deletions

View File

@ -200,7 +200,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
return
}
const session = new SSHShellSession(this.injector, this.sshSession)
const session = new SSHShellSession(this.injector, this.sshSession, this.profile)
this.setSession(session)
this.attachSessionHandler(session.serviceMessage$, msg => {
msg = msg.replace(/\n/g, '\r\n ')

View File

@ -11,7 +11,6 @@ import { SSHProfile } from '../api'
export class SSHShellSession extends BaseSession {
shell?: ClientChannel
private profile: SSHProfile
get serviceMessage$ (): Observable<string> { return this.serviceMessage }
private serviceMessage = new Subject<string>()
private ssh: SSHSession|null
@ -19,10 +18,10 @@ export class SSHShellSession extends BaseSession {
constructor (
injector: Injector,
ssh: SSHSession,
private profile: SSHProfile,
) {
super(injector.get(LogService).create(`ssh-shell-${ssh.profile.options.host}-${ssh.profile.options.port}`))
super(injector.get(LogService).create(`ssh-shell-${profile.options.host}-${profile.options.port}`))
this.ssh = ssh
this.profile = ssh.profile
this.setLoginScriptsOptions(this.profile.options)
this.ssh.serviceMessage$.subscribe(m => this.serviceMessage.next(m))
}