Closed kbrock closed 1 year ago
One comment to add here is that we are testing our highline interface in CI where stdin is not a tty. The true | rake 2>&1 | cat
trick lets you simulate that locally. I also found you can do the same trick with https://github.com/nektos/act if you want to even more simulate GitHub actions' tty.
Thanks @kbrock @Fryguy !
Since "io/console" some "hacks" are not even necessary. I have to take some time to clean up the whole code as we did for v2 release. (Yes, highline exists from a time when there was no "io/console" in Ruby.
Thanks for this great project
Before
Both of these cause a warning:
The warning:
Solution
It no longer calls
stty
for a non-tty. The reasoning being that if you do callstty
, then it will just throw an error and skip thestty
call in the first place. So why call it?This is following the precedence for the terminal size portion that checked
@output.tty?
There are other cases that call the stty methods and catch errors, but those cases have a request to fix them.It looks like many of these use cases are not under test. Please let me know what I can do to help you feel comfortable with these changes