fixed zmodem errors - fixes #6677, fixes #5845, fixes #5243, fixes #5132, fixes #5021, fixes #7511, fixes #7053, fixes #6917, fixes #6639, fixes #6259, fixes #6182, fixes #6122, fixes #5845, fixes #5737, fixes #5701, fixes #5609, fixes #5311, fixes #5243, fixes #5231, fixes #5132

This commit is contained in:
Eugene Pankov
2022-11-20 19:25:48 +01:00
parent 0f0f61f432
commit 9c89bab256
6 changed files with 99 additions and 185 deletions

View File

@@ -4,7 +4,6 @@ import { ipcMain } from 'electron'
import { Application } from './app'
import { UTF8Splitter } from './utfSplitter'
import { Subject, debounceTime } from 'rxjs'
import { StringDecoder } from './stringDecoder'
class PTYDataQueue {
private buffers: Buffer[] = []
@@ -91,7 +90,6 @@ class PTYDataQueue {
export class PTY {
private pty: nodePTY.IPty
private outputQueue: PTYDataQueue
private decoder = new StringDecoder()
exited = false
constructor (private id: string, private app: Application, ...args: any[]) {
@@ -101,7 +99,7 @@ export class PTY {
}
this.outputQueue = new PTYDataQueue(this.pty, data => {
setImmediate(() => this.emit('data', this.decoder.write(data)))
setImmediate(() => this.emit('data', data))
})
this.pty.onData(data => this.outputQueue.push(Buffer.from(data)))