Skip to content
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

Guard to avoid initialization fail. #22

Merged
merged 2 commits into from
Mar 28, 2019

Conversation

nkoturovic
Copy link
Contributor

@nkoturovic nkoturovic commented Feb 28, 2019

Next example resulted in error:

TERM="foo"  # Change $TERM to foo
./demo # executing cppurses demo
# Instead of executing (error prints -> from ncurses::initscr())
Error opening terminal: foo.   # With exit code (1)

Pointing that there is maybe a problem, it might be solved some other (better) way.
Tried to fix it with this patch:

1) If could initialize with $TERM -> okay
2) if not then -> Try to initialize with xterm-256color
3) if both failed then -> Handle error (TODO)

This solution prevents potentially undesired exit(), but on the other hand, hint that there is a problem with $TERM (shown at exit) might be useful for the end user.

Compiled library and tested with demos (everything looks fine).

@a-n-t-h-o-n-y
Copy link
Owner

Looks good, I'm going to make a few changes so that it throws an exception if the screen cannot be initialized

@a-n-t-h-o-n-y a-n-t-h-o-n-y merged commit 8bd3f12 into a-n-t-h-o-n-y:develop Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants