Comments (3)
I decided to have a look at server/tty.c
which seems to be the ZMODEM target area.
Some documents on ZMODEM are:
And in summary they say:
- ZMODEM starts sending proactively with ZPAD,ZPAD,ZDLE,ZHEX or ZPAD,ZDLE,ZBIN or ZPAD,ZDLE,ZBIN32 sequences.
- ZMODEM starts receiving proactively by sending the same variants; the difference follows in the content after these markers.
- The ZPAD are padding, and are the character
*
which can be skipped; looking for ZDLE suffices. ZDLE is octal 030 or hexadecimal 0x18 or decimal 24. - There is a formal protocol end, but also a bail-out form of a sequence of ZDLE, five of which count as a break signal to the recipient (the sender actually sends more).
In TtyWriteAscii()
, the ZDLE character would be marked as non-printable
, so unless control characters were setup for printing, the character would be passed to write_ctrl()
. This holds a case 24
setting DState = ESnormal
to cause normal printing. Supposedly, the ZDLE code (called CAN
in ASCII, and entered manually as ^X
) is not used in normal terminal uses, so this is probably a generic treatment for an unknown code? At least stty -a
does not list ^X
as a signal generator.
So here's the plan that's ripening:
- Pickup on ZDLE and switch the
tty.c
module to a mode for ZMODEM transport. - Have a
builtin.c
element (ortty.c
globals) to which ZMODEM traffic is passed. - In this builtin, recognise the difference between send and receive headers.
- When sender and receiver meet, proxy traffic between them.
- Detect breakdown of ZMODEM and decouple at that time; return
tty.c
to normal.
This allows sz
in one window and rz
in another, and TWIN would couple them. No issue if the commands run on different hosts, of course. They must be true TTY sessions though, nothing like MOSH. SSH would be transparant to these commands though, so remote access is no problem.
There could be room for default connections to the enclosing terminal. This might require option setting. It might cause multiple attached displays to exchange files too.
from twin.
Zmodem is a bear. I implemented it similarly to your strategy early on for Qodem, but could not obtain some of the values I wanted to expose on the download/upload screen. In the end I implemented the entire protocol myself and discovered numerous errors in both the protocol and the (l)rzsz implementation. Most are noted at the top of this.
If you are just looking for a way to do Zmodem download inside any terminal session, LCXterm in passthru mode ('lcxterm -p') will do Zmodem (and Kermit) autostart and download.
from twin.
Spooky, I just compiled QODEM today! Now also got LCXTERM [0], as it seems to be an interesting tool -- TWIN has value as a TUI that does many of the things you do with LCXTERM, but LCXTERM can be run in other/graphical environments to do the same.
I started this topic with an idea that is new AFAIK, namely to directly connect two terminal sessions engaging in ZMODEM where the TUI or GUI is merely a connector; in the understanding that an admin would trust the sites he visited, he could send from one logged-in host and receive on another, and use this to share files. I regularly need that to keep replicated setups properly in sync. This is a new idea, and it could be very pleasant. I did not finish the work, mostly because I'm better at infrastructure than at user interface code, but the idea is still lurking in my mind.
Other uses of ZMODEM that I can see include running a remote configuration shell and needing to pass data in and out for commands, such as certificates or other goodies. When we operate the shell as an AMQP command queue I can easily attach files to commands, but it would be wonderful to have a shell analogon.
[0] Note that your v0.9 release does not have a tag in Git, and lacks the Makefile.in in the release download.
from twin.
Related Issues (20)
- Centos7: Make fails due to fpermissive error HOT 1
- Compiling and running on Termux (Android) HOT 6
- Newbie Question on Screen background HOT 7
- Where's the docs & native X11 decorations HOT 5
- twin --hw=x11 has no numeric pad HOT 6
- xterm mouse support: only 223 chars wide? HOT 13
- Cosmos72 do you want some .debs? HOT 2
- Would you consider putting config in /etc? HOT 11
- Input is _dead_ in `twterm` on 32-bit systems HOT 20
- Long running headless TWIN hangs [on 32-bit system] HOT 10
- Compile error using (intentionally old) g++ 4.9.2 HOT 16
- Twin clients die when connection is lost HOT 13
- hw_X11 and hw_xft don't work as expected in some cases HOT 11
- Crash attaching both --hw=X11 and --hw=xft at the same time HOT 2
- Support for Wayland? HOT 1
- I can't compile on Ubuntu 20.04 HOT 6
- Problems compiling: hw: No such file or directory HOT 2
- Integer overflow when calculating AllocMem() size HOT 1
- I made a deb package and put it into an apt repository HOT 5
- xft install command HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twin.