diff --git a/tabby-ssh/src/components/sshTab.component.ts b/tabby-ssh/src/components/sshTab.component.ts index 36e4d911..4521f873 100644 --- a/tabby-ssh/src/components/sshTab.component.ts +++ b/tabby-ssh/src/components/sshTab.component.ts @@ -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 ') diff --git a/tabby-ssh/src/session/shell.ts b/tabby-ssh/src/session/shell.ts index 2f4c9cfd..1a0a600d 100644 --- a/tabby-ssh/src/session/shell.ts +++ b/tabby-ssh/src/session/shell.ts @@ -11,7 +11,6 @@ import { SSHProfile } from '../api' export class SSHShellSession extends BaseSession { shell?: ClientChannel - private profile: SSHProfile get serviceMessage$ (): Observable { return this.serviceMessage } private serviceMessage = new Subject() 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)) }