mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-10 12:16:34 +03:00
ssh: use correct profile's login scripts - fixes #6064
This commit is contained in:
parent
9c6acf99d0
commit
358a7563f6
@ -200,7 +200,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const session = new SSHShellSession(this.injector, this.sshSession)
|
const session = new SSHShellSession(this.injector, this.sshSession, this.profile)
|
||||||
this.setSession(session)
|
this.setSession(session)
|
||||||
this.attachSessionHandler(session.serviceMessage$, msg => {
|
this.attachSessionHandler(session.serviceMessage$, msg => {
|
||||||
msg = msg.replace(/\n/g, '\r\n ')
|
msg = msg.replace(/\n/g, '\r\n ')
|
||||||
|
@ -11,7 +11,6 @@ import { SSHProfile } from '../api'
|
|||||||
|
|
||||||
export class SSHShellSession extends BaseSession {
|
export class SSHShellSession extends BaseSession {
|
||||||
shell?: ClientChannel
|
shell?: ClientChannel
|
||||||
private profile: SSHProfile
|
|
||||||
get serviceMessage$ (): Observable<string> { return this.serviceMessage }
|
get serviceMessage$ (): Observable<string> { return this.serviceMessage }
|
||||||
private serviceMessage = new Subject<string>()
|
private serviceMessage = new Subject<string>()
|
||||||
private ssh: SSHSession|null
|
private ssh: SSHSession|null
|
||||||
@ -19,10 +18,10 @@ export class SSHShellSession extends BaseSession {
|
|||||||
constructor (
|
constructor (
|
||||||
injector: Injector,
|
injector: Injector,
|
||||||
ssh: SSHSession,
|
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.ssh = ssh
|
||||||
this.profile = ssh.profile
|
|
||||||
this.setLoginScriptsOptions(this.profile.options)
|
this.setLoginScriptsOptions(this.profile.options)
|
||||||
this.ssh.serviceMessage$.subscribe(m => this.serviceMessage.next(m))
|
this.ssh.serviceMessage$.subscribe(m => this.serviceMessage.next(m))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user