Cygwin peek/poll_event asserts wait_fill_event first read
Closed this issue · 7 comments
Using the same sequence of steps as keyboard.c, I get an assert in the very first block of reading code of wait_fill_event (currently line 581).
I'm using the latest 32-bit Cygwin on Win7/64. Since I'm using CMake I made a static library for termbox.c and utf8.c to live in.
I tried disabling the initial reading section of wait_fill_event, and that worked, until a resize occurred. Upon resizing the block of reading code in the while loop (currently line 613) would assert on errno==EAGAIN.
Never tried it on cygwin. Frankly I don't like cygwin. But I'll take a look at it.
P.S. Termbox go version (github.com/nsf/termbox-go) has native windows implementation. But I'm a bit lazy to do the same for C version.
I have to work within Cygwin all the time and if termbox turns out to meet my needs I don't have to learn curses :) If you come up with anything to try, I'll try it.
Installed cygwin, I can confirm it doesn't work indeed and dies with the mentioned assert. I'll see what can be done within next 2-3 days.
Take a look, should work now.
It works, in that I can display stuff and read simple keystrokes, and winch doesn't cause a crash. I think there's an issue with key chords like CTRL+PGDN, though. If you run keyboard on Cygwin or Linux (Deb. Wheezy, gnome terminal) and press that combination, you'll just see the display of a "" key (SHIFT and the "`/" key highlighted) because that's the last character of the ANSI escape sequence. It seems like the sequence for CTRL+PGDN begins with a "CSI" (esc+"[") and ends with a "~". It does the same thing under xterm in the aforementioned Linux environment. I can start an issue for this if you like.
It's not an issue. Termbox simply doesn't support them. It supports only a common subset of keys most terminals support. And this is a rather limited subset.
I understand how inconvenient it is, but that's how it is. There is no way to detect an unknown key sequence.