Skip to content

Commit

Permalink
fixed incorrect passthrough handling in zmodem
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Mar 19, 2022
1 parent 45b6e21 commit 7806914
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tabby-terminal/src/features/zmodem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,22 @@ export class ZModemDecorator extends TerminalDecorator {
}

attach (terminal: BaseTerminalTabComponent): void {
let isActive = false
const sentry = new ZModem.Sentry({
to_terminal: data => {
if (!terminal.enablePassthrough) {
if (isActive) {
terminal.write(data)
}
},
sender: data => terminal.session!.feedFromTerminal(Buffer.from(data)),
on_detect: async detection => {
try {
terminal.enablePassthrough = false
isActive = true
await this.process(terminal, detection)
} finally {
terminal.enablePassthrough = true
isActive = false
}
},
on_retract: () => {
Expand Down

0 comments on commit 7806914

Please sign in to comment.