Is there really no glibc equivalent for getch() that handles the terminal mode for you? I ask only because I have often seen incorrect Windows answers on Stack Overflow, so when I look at an answer for a platform I'm unfamiliar with, I'm never sure:https://stackoverflow.com/questions/7469139/what-is-the-equivalent-to-getch-getche-in-linux …
-
-
I've found curses rough for my regular printf style terminal apps. Once you init curses, seems all your output are belong to it. (Unless I'm missing something). In any case, I just wind up going with the stackoverflow answers (like below). Also a bit rough...pic.twitter.com/tX6L51nMt1
-
correct, once curses is on then all terminal IO should go though the curses API. and yeah, can set the terminal input mode to be "cbreak" style yourself, and write a getch fairly easily from there.
End of conversation
New conversation -
-
-
I haven't found where to begin the long muddled source code reading descent to try and understand how to handle this. (Perhaps seeing how a simple terminal emulator -- st? -- does things?) For simple progress report (ie. basic output highlight) curses should be overkill, right?
-
Oh, yeah, you can totally set char-at-a-time input reading without curses by using a combination of ioctl, tcgetattr, and tcsetattr.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.