Skip to content

Commit

Permalink
fixed zmodem errors - fixes #6677, fixes #5845, fixes #5243, fixes #5132
Browse files Browse the repository at this point in the history
, 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
  • Loading branch information
Eugeny committed Nov 20, 2022
1 parent 0f0f61f commit 9c89bab
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 185 deletions.
4 changes: 1 addition & 3 deletions app/lib/pty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = []
Expand Down Expand Up @@ -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[]) {
Expand All @@ -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)))
Expand Down
105 changes: 0 additions & 105 deletions app/lib/stringDecoder.ts

This file was deleted.

11 changes: 10 additions & 1 deletion tabby-terminal/src/api/baseTerminalTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit

protected logger: Logger
protected output = new Subject<string>()
protected binaryOutput = new Subject<Buffer>()
protected sessionChanged = new Subject<BaseSession|null>()
private bellPlayer: HTMLAudioElement
private termContainerSubscriptions = new SubscriptionContainer()
Expand Down Expand Up @@ -153,6 +154,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
}

get output$ (): Observable<string> { return this.output }
get binaryOutput$ (): Observable<Buffer> { return this.binaryOutput }

get resize$ (): Observable<ResizeEvent> {
if (!this.frontend) {
Expand Down Expand Up @@ -369,7 +371,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
this.configure()

setTimeout(() => {
this.output.subscribe(() => {
this.binaryOutput$.subscribe(() => {
this.displayActivity()
})
}, 1000)
Expand Down Expand Up @@ -564,6 +566,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
}
})
this.output.complete()
this.binaryOutput.complete()
this.frontendReady.complete()

super.destroy()
Expand Down Expand Up @@ -741,6 +744,12 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
}
})

this.attachSessionHandler(this.session.binaryOutput$, data => {
if (this.enablePassthrough) {
this.binaryOutput.next(data)
}
})

if (destroyOnSessionClose) {
this.attachSessionHandler(this.session.closed$, () => {
this.destroy()
Expand Down
2 changes: 1 addition & 1 deletion tabby-terminal/src/api/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SessionMiddleware {
}
}

export class SesssionMiddlewareStack extends SessionMiddleware {
export class SessionMiddlewareStack extends SessionMiddleware {
private stack: SessionMiddleware[] = []
private subs = new SubscriptionContainer()

Expand Down
Loading

0 comments on commit 9c89bab

Please sign in to comment.