-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange suspend and halt behavior on MacOS, when using /dev/tty as inputFd #364
Comments
As I look at the snippet you provided above, I wonder if this will work as intended if you only ever open So my suggestion is to take the two lines starting with |
@danchoi I wanted to check in on this again and see if you have had any time to try out my suggestion above. |
@jtdaugherty sorry for the delay. Thank you for your suggestion, but when trying it the issue I reported still happens. Here is the modified code:
|
Thanks! I'm doing some investigation. You can check out my minimal demo program here: https://github.com/jtdaugherty/brick-suspend-issue/blob/main/Main2.hs I think that the program shows that it isn't a Brick or Vty problem (although once I understand the problem, then we'll see where the solution belongs; maybe in Vty). That demo program is the essence of what is going on inside of Vty when you are having the problem that you reported in this ticket. That demo program behaves the same for its |
Thank you very much @jtdaugherty for investigating this. |
There's now this related GHC ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/21503 |
This github project demonstrates an issue I've discovered with suspending and halting in Brick.
I modified Brick's demo program brick-suspend-resume-demo to use the
/dev/tty
handle directly as the configuredinputFd
:The reason I wanted to do this was so I can use data piped from STDIN into a Brick program. Because the
inputFd
is assigned tostdin
by default, I need it to be assigned explicitly to/dev/tty
in order to make the terminal UI interactive.If you compile and run my demo executable in the Ubuntu Terminal (tested on Ubuntu 20.04), pressing SPACE once suspends and pressing ESC once quits -- just like the original demo.
If you run the executable in the MacOS Terminal (macOS Montery, Apple M1 Pro), pressing SPACE or ESC once isn't sufficient. You need to press another key afterward to make the suspend or quit command register. Is this bug, or is there something wrong with my Haskell code?
The text was updated successfully, but these errors were encountered: