Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Zmodem(rz/sz) addon #4471

Open
jooy2 opened this issue Apr 10, 2023 · 6 comments
Open

Support Zmodem(rz/sz) addon #4471

jooy2 opened this issue Apr 10, 2023 · 6 comments
Labels
type/proposal A proposal that needs some discussion before proceeding

Comments

@jooy2
Copy link

jooy2 commented Apr 10, 2023

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,

@jerch
Copy link
Member

jerch commented Apr 10, 2023

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
Copy link
Author

jooy2 commented Apr 10, 2023

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
Copy link
Member

jerch commented Apr 11, 2023

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
Copy link

maybe trzszjs better

@Tyriar
Copy link
Member

Tyriar commented May 16, 2023

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.

@Tyriar Tyriar added the type/proposal A proposal that needs some discussion before proceeding label May 16, 2023
@jooy2
Copy link
Author

jooy2 commented May 16, 2023

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
Labels
type/proposal A proposal that needs some discussion before proceeding
Projects
None yet
Development

No branches or pull requests

4 participants