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

labgrid-client console: add escape sequence to call other client commands #1386

Open
khilman opened this issue May 2, 2024 · 3 comments
Open

Comments

@khilman
Copy link
Contributor

khilman commented May 2, 2024

Story: I'm using labgrid-client -p <place> console to connect to a place. From within the console window, I want to trigger a power on/off/cycle (e.g. the equivalent of callling labgrid-client -p <place> power cycle from another shell.)

This request is inspired by similar feature in conmux where for any given console, you can use an escape sequence (e.g. ~$ in conmux) which can commands on the host where the conmux server (same as labgrid-exporter) is running.

@Emantor
Copy link
Member

Emantor commented May 3, 2024

I had the same idea as well and do have a prototype somewhere which implements a labgrid-client CLI which takes commands and executes them without closing the client connection. To implement this we would either need to write our own RFC2711 client with an escape sequence for this CLI or wire up the RFC2711 client that is AFAIR included within pyserial.

@jluebbe
Copy link
Member

jluebbe commented May 3, 2024

I'd find that useful as well, but it would probably mean using an internal telnet/RFC2711 client instead of microcom. Also, it would lend itself to supporting hot keys as well (e.g. CTRL-<something> to trigger a power cycle or a strategy state). So far we've shied away from that due to the possible maintenance required.

How is this done in conmux? Do you have a link to the relevant code?

@khilman
Copy link
Contributor Author

khilman commented May 3, 2024

You can see some discussion of it in the conmux docs here (search for escape):
https://autotest.readthedocs.io/en/latest/main/remote/Conmux-OriginalDocumentation.html

And the code is here: https://github.com/autotest/autotest/tree/master/conmux
Though TBH, I haven't ever looked at this code (it's in perl) so I won't pretend to understand how it works.

More specifically, it seems like it's here where the conmux escape sequence ~$ is handled:
https://github.com/autotest/autotest/blob/0862aa74389bf434533697a9d970cf91e03b09ce/conmux/conmux#L1049

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

No branches or pull requests

3 participants