-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
sequences for TE data actions #4943
Comments
Could this sort of thing not be achieved with something like the sz/rz protocol (zmodem?). The terminal would just need to give users an option to configure what happens when a file is received. Typically this would be a "save to disk" prompt, but I don't see why it couldn't be configured to automatically open certain file types in a client side editor. I'm not sure about saving, but maybe if the terminal monitors the local copy of the file for changes, it could also provide the option to upload those changes back to the source. I haven't used this sort of thing in decades, so my understanding of things may be wrong. But if there's an existing protocol that is reasonably applicable, I'd definitely prefer that over inventing something new. |
Are you thinking of a protocol to handle all 3 of your examples? That seems difficult. Or perhaps a framework for a family of protocols? You first example seems reasonably doable. You would have a command like
Is that the kind of thing you had in mind? |
@j4james Oh you got me here, the idea is in fact a spinoff from my current attempt to get rid of modem protocols as the main driver for file upload/download for several reasons:
So at the core the idea above is indeed about how to transport data safely between terminal and application side, but in a more terminal friendly way. My current not yet published protocol attempt for this completely relies on POSIX coreutils (no need for a custom client app) with the help of shell functions to be used like this
Yes, thats the gist of the idea. In the end, actions should be configurable on TE side, and allow to retrieve or send data from/to application side.
Indeed the third example is an extreme, as it would extend the idea even to bi-directional streams. My zmodem replacement currently supports multiple up- or download sources running concurrently (ofc it has to be in-band serialized), so per se I see no reason, why it should not be possible to handle bi-directional streams as well. True - that might need a much broader spec foundation possibly leading to a family of sub-protocols (have not yet put much thinking into the the bi-di streams). Your
Yeah this prolly has to go through a TE defined mapping to avoid calling into some random app as told by application side. What might work here (not thought out yet):
What always should work here too - write a big fat cmdline app. This has the downside of the additional install step, but also some pros like being able to use the PTY transport in much faster raw mode (thats very limited with shell functions, many coreutils are very line centric as I had to find out), or being able to do an early libmagic content deduction on application side (not sure yet, if such an automagic functionality is a good idea). |
Regarding the POSIX utils compat part: |
Again I haven't worked with this stuff in a long time, so I'm not sure how complicated it would be to implement, but I know there are a number of terminals that have sz/rz support, so it's definitely possible. Also it's one of the most popular feature requests for Windows Terminal, so if it is possible, it's quite likely we'll implement it at some point. And once we have that, I can't imagine there'll be much demand for an unknown protocol that does more or less the same thing.
But if I've understood you correctly, your proposal would require a "custom client" as well - it's just in the form of a script limited to POSIX coreutils. If that's the only selling point, I'd be more inclined to just paste a uuencoded binary onto the system. Anyway, I'll leave it at that. I'm not particularly interested in the idea, but don't let me stop you. |
@j4james Well, you will run into several state ambiguities with zmodem up to a point where you have to parse heuristically and dispatch the data either to the zmodem or the vt parser. I am sure you will figure it yourself once you get at the protocol byte level, it does not blend at all with VT sequences. And the fact that zmodem is used by some TEs does not make it a good choice per se. It is more for historical reasons, when modem usage was still a thing.
As I wrote above - Edit: |
The following rough idea might seem pretty wild at a first glance, but could turn a TE into a swiss army knife for remote administration tasks of stripped-down target machines . The idea in fact borrows some concepts of intelligent terminals of the 80s, but with a different interface idea (TBD, not strictly limited to the terminal view).
Idea
Extend the terminal API by sequences introducing a document/dataset + action concept. The sequences will allow the TE to exchange annotated data from any data source on application side (e.g. a file, a pipe etc) and do something with it on TE side. Getting any data is already possible with
cat
but has low to no usage, as it just spits out the data into the terminal buffer. Typically preinstalled client apps come to a rescue here, but what if we would move that client logic to TE side instead? Quick examples:I am pretty aware that there are already tons of tools or other protocols to achieve the same goal, the convenience bonus here mostly comes from:
Audience
This is mostly directed towards sys admins (or in new business-speech "sysops"), that have to deal with different remote system setups, where a more clever handling of various datasets on TE side might be a relief for everyday tasks. It is def. not much of a help for mostly local terminal usage, so overall benefit might be limited. Therefore I'd like to hear opinions on that early idea first, before inventing a square wheel. Feel free to enhance or completely debunk the idea, esp. regarding possible pitfalls like security aspects.
FYI: @Tyriar, @meganrogge, @mofux, @textshell, @christianparpart, @j4james, @hackerb9, @PerBothner
The text was updated successfully, but these errors were encountered: