Maybe CBL_READ_KBD_CHAR shouldn't depend on environment variables like COB_SCREEN_EXCEPTIONS and COB_SCREEN_ESC. It's a great idea to reuse the code in cob_get_char(), but I'm sure I won't be the last person who's confused by the need to set those environment variables. It's late and I have to go to bed, but I'll put together a proposed solution tomorrow and you can evaluate it.
Maybe CBL_READ_KBD_CHAR shouldn't depend on environment variables like COB_SCREEN_EXCEPTIONS and COB_SCREEN_ESC. It's a great idea to reuse the code in cob_get_char(), but I'm sure I won't be the last person who's confused by the need to set those environment variables.
Maybe CBL_READ_KBD_CHAR shouldn't depend on environment variables like COB_SCREEN_EXCEPTIONS and COB_SCREEN_ESC. It's a great idea to reuse cob_get_char(), but I'm sure I won't be the last person who's confused by the need to set those environment variables.
Maybe CBL_READ_KBD_CHAR shouldn't depend on environment variables like COB_SCREEN_EXCEPTIONS and COB_SCREEN_ESC.
Typo. I have to set COB_SCREEN_ESC, not COB_SCR_ESC.
I wanted to try COB_SCREEN_EXCEPTIONS=true COB_SCR_ESC=true ./readchar.cbl on Linux before I said anything more, because I was worried that I was having some OS X-specific problem. No; it behaves exactly like it does on OS X: hitting the escape key causes no visible response. I'll try gdb'ing to see if I can figure out why.
When it's OK for the program to block until a character is hit, there's no reason to bother with CBL_GET_KBD_STATUS. You can just call CBL_READ_KBD_CHAR. But when you have a long-running job that the user can checkpoint for later continuation by hitting a key, you need to be able to avoid blocking. CBL_GET_KBD_STATUS is probably overused by the authors of my app, but there are some places where nothing will substitute.
I tried COB_SCREEN_EXCEPTIONS=true COB_SCR_ESC=true ./readchar and nothing changed. Is that what I should have tried?