mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 18:07:58 +00:00
telnet: fixed size negotiation order
This commit is contained in:
@@ -170,7 +170,7 @@ export class TelnetSession extends BaseSession {
|
||||
}
|
||||
if (command === TelnetCommands.DO) {
|
||||
if (option === TelnetOptions.NEGO_WINDOW_SIZE) {
|
||||
this.resize(0, 0)
|
||||
this.emitSize()
|
||||
} else if (option === TelnetOptions.ECHO) {
|
||||
this.echoEnabled = true
|
||||
this.emitTelnet(TelnetCommands.WILL, option)
|
||||
@@ -210,10 +210,18 @@ export class TelnetSession extends BaseSession {
|
||||
this.lastHeight = h
|
||||
}
|
||||
if (this.lastWidth && this.lastHeight && this.telnetProtocol) {
|
||||
this.emitSize()
|
||||
}
|
||||
}
|
||||
|
||||
private emitSize () {
|
||||
if (this.lastWidth && this.lastHeight) {
|
||||
this.emitTelnetSuboption(TelnetOptions.NEGO_WINDOW_SIZE, Buffer.from([
|
||||
this.lastWidth >> 8, this.lastWidth & 0xff,
|
||||
this.lastHeight >> 8, this.lastHeight & 0xff,
|
||||
]))
|
||||
} else {
|
||||
this.emitTelnet(TelnetCommands.WONT, TelnetOptions.NEGO_WINDOW_SIZE)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user