You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that mkVty calls inputForCurrentTerminal and outputForCurrentTerminal which open stdin and stdout. For my own use I made two new functions inputForNewTerminal and outputForNewTerminal which both open /dev/tty instead of stdin and stdout. I then copied intMkVty and made a slightly modified mkVty that calls the 'NewTerminal' functions instead of the 'CurrentTerminal' ones. This allows for redirecting stdin and stdout while still maintaining interactivity. It doesn't seem to have any other effects on vty.
My questions are: am I mistaken in my method to achieve this behavior; does vty support programs that may redirect stdin and stdout without a stub and I was just going about it incorrectly? If not, is supporting this type of behavior desirable?
The text was updated successfully, but these errors were encountered:
You are not mistaken. mkVty did offer no configuration of the terminal file descriptor. The methods for creating Output and Input structures that used specific file descriptors were not used by mkVty.
I've pushed a change that should resolve this: ddd61dd
This adds input and output file descriptors as optional properties of the Config structure. For your application a Config structure with inputFd and outputFd set appropriately can be passed to mkVty to achieve the desired effect.
I'm still testing this change, but plan on releasing once testing completes. Once my testing is complete I'll resolve this issue.
Thanks for the feedback! This was a good opportunity to resolve a historical oddity in vty.
I see that
mkVty
callsinputForCurrentTerminal
andoutputForCurrentTerminal
which open stdin and stdout. For my own use I made two new functionsinputForNewTerminal
andoutputForNewTerminal
which both open/dev/tty
instead of stdin and stdout. I then copiedintMkVty
and made a slightly modified mkVty that calls the 'NewTerminal' functions instead of the 'CurrentTerminal' ones. This allows for redirecting stdin and stdout while still maintaining interactivity. It doesn't seem to have any other effects on vty.My questions are: am I mistaken in my method to achieve this behavior; does vty support programs that may redirect stdin and stdout without a stub and I was just going about it incorrectly? If not, is supporting this type of behavior desirable?
The text was updated successfully, but these errors were encountered: