gchp / rustbox

Rust implementation of the termbox library
MIT License
469 stars 48 forks source link

init dies without returning Err? #49

Closed droundy closed 9 years ago

droundy commented 9 years ago

I am seeing rustbox::init die without returning Err. I'm not sure how this happens or why, but it happens when I run in a terminal over ssh. The difference may, however, be in the different computers rather than the ssh connection, since I can't test in person on the computer that has the trouble, since it's on the wrong side of the country.

You can (maybe) reproduce this problem by running:

git clone git://github.com/droundy/pmail
cd pmail
cargo build
target/debug/textmode-pmail

If it works properly ctrl-q enables you to exit. When it fails, it exits without blanking the screen, and leaves something like the following:

examining secret myself
Pmail starting! PublicKey([153, 3, 192, 37, 53, 25, 134, 237, 70, 201, 10, 3, 53, 138, 150, 133, 16, 141, 76, 3, 252, 140, 7, 171, 181, 238, 236, 64, 156, 188, 145, 58])
Initializing rustbox.
Wrote addressbook successfully!

The last line indicates that a local variable has been dropped, meaning that there seems to have been a relatively clean exit. But a println! inserted in the error path failed to be shown.

droundy commented 9 years ago

Sorry, false alarm. It was a bug in my own code.