Skip to content

Support Zmodem(rz/sz) addon #4471

@jooy2

Description

@jooy2

Thanks to the developers for creating an amazing terminal module and supporting it to this day.

image

It would be nice to have separate support for the Zmodem add-on to receive or send files to the terminal using lrzsz. Zmodem is still one of the solutions for file transfer supported by many terminal emulators.

I realize that there are already old closed issues about this. (#279) However, as explained in (#1128 (comment)), the Zmodem add-on has now been removed, so I felt the need to reopen these issues.

Similarly, I found the following third-party solution (ZmodemJS), but it doesn't seem to be maintained since 2020.
https://github.com/FGasper/zmodemjs

Are there currently any other solutions for supporting Zmodem that I'm not aware of? If not, it would be awesome if Xterm.js supported Zmodem via an add-on.

Regards,

Activity

jerch

jerch commented on Apr 10, 2023

@jerch
Member

Well zmodem is tricky, as it actually competes with VT sequences on protocol level. Terminal emulators (TE) supporting it have to stop their terminal magic and spin up a zmodem parser. So technically not the VT TE supports zmodem, but some sort of a preparser doing the zmodem vs VT parser belly dance. And thats nothing to get done right easily, as zmodem relies on a magic introducer, which is also perfectly valid in terminal data, so you might end up with ambiguity (you gonna need some read ahead logic to decide, whether it is real zmodem data). Kinda every terminal with zmodem support suffer from this, and correct recovery from zmodem ambiguity is rather hard to impossible for some edge cases (yes you can render a terminal with zmodem support unusable by "carefully crafting" the data).
This needed complexity outside of the real terminal logic made us stop supporting the old zmodem addon.

A much better way to get file transfers rolling is to shape things into its own dedicated terminal sequence without any ambiguity at the higher protocol level. There are some attempts into that direction, but none took broader adoption yet, an so has xterm.js nothing in this regard yet either.

jooy2

jooy2 commented on Apr 11, 2023

@jooy2
Author

Thanks for the detailed explanation.
I just wanted to check what the status was on the implementation of this feature.

Hopefully the technical difficulties will be resolved in the near future and Zmodem will be implemented.

jerch

jerch commented on Apr 11, 2023

@jerch
Member

Well, feel free to contribute a solution. But as I wrote above, the "technical difficulties" cannot be fully resolved, as it is an inherent issue of a protocol clash.

zundaren

zundaren commented on Apr 27, 2023

@zundaren

maybe trzszjs better

Tyriar

Tyriar commented on May 16, 2023

@Tyriar
Member

I never bothered to look into how zmodem works, I wasn't comfortable maintaining the old addon as I didn't use or understand it. Feels out of scope to me still.

added
type/proposalA proposal that needs some discussion before proceeding
on May 16, 2023
jooy2

jooy2 commented on May 17, 2023

@jooy2
Author

Thanks for sharing information.

I recently found something like this: (Just thought I'd share it for reference.)

The following Xterm written in Dart seems to support Zmodem.
I don't know what the structure of this is, but it might be a helpful reference for someone.

https://github.com/TerminalStudio/xterm.dart
https://github.com/TerminalStudio/zmodem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    out-of-scopetype/proposalA proposal that needs some discussion before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Tyriar@jerch@zundaren@jooy2

        Issue actions

          Support Zmodem(rz/sz) addon · Issue #4471 · xtermjs/xterm.js