Re: Mimicking a shell

2020-01-06 Thread Jan via Digitalmars-d-learn
I think the suggestion of angel would be most fitting for my case. As angel said, the using the C code for D would be a relatively small refactor. if you want to send like a synthetic arrow keystroke, well, things get ugly again, it will need to send the right series of bytes based on what

Re: Mimicking a shell

2020-01-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 4 January 2020 at 18:43:13 UTC, Jan wrote: I am using Linux (Fedora). ok, the starting point is `openpty` which gives you a communication pipe that the other program sees as a terminal. from there if you are just forwarding you can perhaps shoot bytes to and from without

Re: Mimicking a shell

2020-01-04 Thread Jan via Digitalmars-d-learn
On Sunday, 29 December 2019 at 19:21:53 UTC, Adam D. Ruppe wrote: On Sunday, 29 December 2019 at 17:03:14 UTC, Jan wrote: Is there a way to forward all input and output from a shell? yes, but it is platform specific and can be a decent amount of code. what OS are you on? I am using Linux

Re: Mimicking a shell

2019-12-29 Thread angel via Digitalmars-d-learn
On Sunday, 29 December 2019 at 17:03:14 UTC, Jan wrote: Hi, Is there a way to forward all input and output from a shell? This implies that e.g. pressing the left arrow on the keyboard is immediately being forwarded to the shell and that the output from a shell would be *exactly* the same as

Re: Mimicking a shell

2019-12-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 29 December 2019 at 17:03:14 UTC, Jan wrote: Is there a way to forward all input and output from a shell? yes, but it is platform specific and can be a decent amount of code. what OS are you on?

Mimicking a shell

2019-12-29 Thread Jan via Digitalmars-d-learn
Hi, Is there a way to forward all input and output from a shell? This implies that e.g. pressing the left arrow on the keyboard is immediately being forwarded to the shell and that the output from a shell would be *exactly* the same as output from my D program (that would include the prompt