trycmd
                                
                                
                                
                                    trycmd copied to clipboard
                            
                            
                            
                        Testing interactive programs
Thanks for this awesome library, it looks really awesome.
I was wondering if there is some support or setting that'd allow testing a binary that expects inputs from the user on the terminal.
Currently, I tried setting that up by using the *.toml format and providing a *.stdin file.
That unfortunately doesn't seem to work, as I get the error Failed to initialize input reader from the library I use (inquire). So it seems it needs some kind of proper TTY/PTY to function properly.
All the other features look really great, as my project is a code generator for new projects, and I want to verify that the generation works, where the *.out features is extremely convenient for verification.
Sounds like there are two requests here, TTY support so it can work with inquire and pexpect support.
Could you split these out into separate issues?
I split off the request about pexpect-ish support into #102 now 🙇♂️
To give some more details about the inquire crate: I use it with the crossterm crate as backend, and it uses its enable_raw_mode when prompting the user. If that one fails (as it does without a TTY), it'll not be able to run the prompt.
So some sort of TTY or PTY seems to be definitely required for this, and likely for other interactive CLI apps too, as it needs some way to access advanced terminal features, rather than just stdin/stdout.
https://docs.rs/portable-pty/0.7.0/portable_pty/ might be useful for this