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

change the way of interacting with cli-server, write to the client tty directly on mac/linux #9104

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

davidfirst
Copy link
Member

@davidfirst davidfirst commented Aug 8, 2024

Linux OS family treat the tty (terminal) as any other file, so it has an actual file path we can write into.
When a client runs a bit command (using the env variable of enabling the cli-server) it sends its tty path to the server. The server (in the cli-raw route) monkey patches (no choice here) the process.stdout.write and adds additional write - to the tty path. This way, the client gets all the data stream in between the request and the response.

@davidfirst davidfirst merged commit eba5fab into master Aug 8, 2024
11 checks passed
@davidfirst davidfirst deleted the cli-server-write-tty-directly branch August 8, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants