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

add support for arbitrary file descriptors on unix #612

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-mueller678
Copy link

This allows the use of arbitrary file descriptors on unix in response to issue #542. File Descriptors are supplied via a new variant of config::Bhaviour

@gwenn
Copy link
Collaborator

gwenn commented Apr 7, 2022

Could you please explain why only unix is supported ?
And I am afraid that this PR doesn't work for telnet / ssh connection because isatty will return false (jline3 seems to use the system flag to skip isatty check). So I guess we need something more complicated than a file descriptor...

@m-mueller678
Copy link
Author

My main use case for this feature is working with pseudoterminals other than the one controlling the process.

Only Unix is supported because I don't have a Windows machine to work on and don't have any experience with Windows terminal handling. Not for any technical reason.

This does indeed not work well with things other than TTYs. I don't think you can reliably support anything that is not a TTY because you cannot change to raw mode without termios as far as I know. Do you think a flag to override isatty and just assume the user set everything up as needed would be a good idea? If so, Behavior::ArbitraryFileDescriptors seems like a good place to put it. Anyone using this should have to consciously make this choice, and the other behaviours likely don't need it.

As a side note: My current workaround for supporting ssh is to just hijack the pseudo terminal slave. If necessary, I send SIGSTOP to its controlling process to ensure it doesn't steal any of my input.

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

Successfully merging this pull request may close these issues.

2 participants