1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-22 20:55:03 +03:00

ssh: fixed newlines in banners/MOTD - fixes #5905

This commit is contained in:
Eugene Pankov 2022-03-08 21:12:12 +01:00
parent b31b500727
commit f073a691fc
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -124,6 +124,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
} }
this.attachSessionHandler(session.serviceMessage$, msg => { this.attachSessionHandler(session.serviceMessage$, msg => {
msg = msg.replace(/\n/g, '\r\n ')
this.write(`\r${colors.black.bgWhite(' SSH ')} ${msg}\r\n`) this.write(`\r${colors.black.bgWhite(' SSH ')} ${msg}\r\n`)
}) })
@ -202,6 +203,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
const session = new SSHShellSession(this.injector, this.sshSession) const session = new SSHShellSession(this.injector, this.sshSession)
this.setSession(session) this.setSession(session)
this.attachSessionHandler(session.serviceMessage$, msg => { this.attachSessionHandler(session.serviceMessage$, msg => {
msg = msg.replace(/\n/g, '\r\n ')
this.write(`\r${colors.black.bgWhite(' SSH ')} ${msg}\r\n`) this.write(`\r${colors.black.bgWhite(' SSH ')} ${msg}\r\n`)
session.resize(this.size.columns, this.size.rows) session.resize(this.size.columns, this.size.rows)
}) })