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

DISCUSSION: An example of running terminal (either Windows Terminal, or conhost) attached to pseudo console #8819

Open
vvavrychuk opened this issue Jan 18, 2021 · 4 comments
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements
Milestone

Comments

@vvavrychuk
Copy link

vvavrychuk commented Jan 18, 2021

I would like to feed/consume pseudo console pipes from my application and have some terminal (either Windows Terminal, or conhost) connected to this pseudo console. This is almost like https://github.com/microsoft/terminal/tree/main/samples/ConPTY/EchoCon but a little bit reversed. In EchoCon, application that feeds pseudo console (ping) is running as a separate process and current process is assumed to be run from terminal. But I want current process to feed pseudo console (current process can be run from terminal or not, it should not matter), and some terminal should be run from my application connected to pseudo console in a separate window.

The background is that I am porting application from Linux which uses multiple pseudo-consoles in one process. It is reading and writing to/from them in one thread sequentially. And it spawns multiple xterms connected to those pseudo consoles.

If I create multiple Windows pseudo consoles in one process, how can I spawn multiple terminal applications (conhost.exe?, Windows Terminal) to output content of those pseudo consoles?

@vvavrychuk vvavrychuk added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jan 18, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jan 18, 2021
@zadjii-msft
Copy link
Member

Okay so it might be helpful to have additional terminology defined here.

  • a "commandline client" application is something like ping, bash, etc. It's a application that emits text output and reads text input.
  • a "terminal" application is something that can be used for displaying the text output by a client app, and can read input from the OS and send it to a client app.

So it sounds like you have a client app that needs to output to multiple terminals all at once, correct? Kinda like a reverse tmux, correct? We can try helping come up with a clever solution, but I want to make sure we understand the scenario fully.

@zadjii-msft zadjii-msft added Issue-Question For questions or discussion Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jan 19, 2021
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jan 23, 2021
@ghost
Copy link

ghost commented Jan 23, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@vvavrychuk
Copy link
Author

@zadjii-msft you are absolutely right!

I have tried to code example here https://github.com/vvavrychuk/multipty-example/blob/master/multipty.c

It opens given number of ptys and launches xterm for each using -S flag. If user types something in xterm, it returns back to main application
Screenshot from 2021-01-25 01-06-16

There should be also a way to type client id and message in main application and it will be sent to corresponding client, but that's not finished in this example.

Also, I should probably use non-buffered IO...

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Jan 24, 2021
@DHowett
Copy link
Member

DHowett commented Jan 28, 2021

I'm going to take triage off this, but keep it open as a discussion question. 😄 Thanks!

@DHowett DHowett removed Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jan 28, 2021
@DHowett DHowett changed the title An example of running terminal (either Windows Terminal, or conhost) attached to pseudo console DISCUSSION: An example of running terminal (either Windows Terminal, or conhost) attached to pseudo console Jan 28, 2021
@zadjii-msft zadjii-msft added this to the Backlog milestone Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements
Projects
None yet
Development

No branches or pull requests

3 participants