kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
22.86k stars 923 forks source link

zmodem #7600

Closed jarkkojs closed 1 week ago

jarkkojs commented 1 week ago

This is a truly nice feature in kitty for kernel dev:

https://sw.kovidgoyal.net/kitty/kittens/transfer/

E.g. if I have some test VM, FPGA board, SBC or similar, for which I might only have IP this feature makes transferring files super convenient.

However, sometimes, especially in early hardware prototypes, serial port is the only option.

I PoC'd late last year a Rust crate, which can do ZMODEM based on some earlier work on the topic: https://codeberg.org/jarkko/zmodem. Since then I've been looking for a proper project to integrate it (and further polish).

One thing that ZMODEM provides but this code does not have yet, is "cancel". ZMODEM protocol does have patterns for that, and it is only left out because it does not make sense to add that extra meat before the basic flow is tested and fully integrated.

Since it is small and compact, it would take probably only few days to rewrite the whole thing in C. If I wrote that and provided the zmodem functionality for kitty, do you have ideas and/or motivation to get it further integrated to the transfer functionality?

ZMODEM can be made much more sleeker than it is e.g. in minicom or similar software because they rely on spawning lrzsz, which make tuning interactions during the file transfer pretty somewhat to implement.

kovidgoyal commented 1 week ago

Not sure I follow. Why do you want to use ZMODEM rather than the kitty file transfer protocol, which is much more capable? https://sw.kovidgoyal.net/kitty/file-transfer-protocol/

It supports all sorts of goodies like authentication, file metadata, delta compression (rsync) etc. Why not write a client for this if for some reason the existing kitten static binary is not suitable?

I am not keen to add support for zmodem to kitty since it already supports a better protocol.

jarkkojs commented 1 week ago

Not sure I follow. Why do you want to use ZMODEM rather than the kitty file transfer protocol, which is much more capable? https://sw.kovidgoyal.net/kitty/file-transfer-protocol/

It supports all sorts of goodies like authentication, file metadata, delta compression (rsync) etc. Why not write a client for this if for some reason the existing kitten static binary is not suitable?

I am not keen to add support for zmodem to kitty since it already supports a better protocol.

For login into hardware, which does not have a NIC yet through serial port and transferring files, which is common use case in in-development hardware.

kovidgoyal commented 1 week ago

Sorry I still dont follow, the medium of transmission is irrelevant, whether its a serial port or a tcp based network doesnt matter to the protocol used.

jarkkojs commented 1 week ago

Ah, right I was confused by the example which stared with kitty ssh, and only now found https://sw.kovidgoyal.net/kitty/file-transfer-protocol/. So I'll give this a shot :-)