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

[Feature Request] Allow for TTYs other than STDIN #275

Open
upsampled opened this issue Sep 17, 2023 · 0 comments
Open

[Feature Request] Allow for TTYs other than STDIN #275

upsampled opened this issue Sep 17, 2023 · 0 comments

Comments

@upsampled
Copy link

upsampled commented Sep 17, 2023

Feature Request

Right now it appears like go-prompt only works with STDIN. In order to run it on a console port, I currently use SystemD to perform STDIN redirection and a few other hacks (set windows size etc.). I think I could replace systemd with syscall.Dup2 but I don't have time to experiment much more.

StandardInput=tty
StandardOutput=tty
TTYPath=/dev/...

Anyhow if you can confirm that:

  1. there is not nicer way to do this
  2. that adding a parameter TTY *os.File parameter to Options would be a good way for go-prompt to accept an external TTY

then I'll work on a PR

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

1 participant