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

connman_ncurses crashes at initialization phase if LINES < 24 || COLS < 80 #1

Open
javier-lopez opened this issue Jan 21, 2015 · 6 comments

Comments

@javier-lopez
Copy link
Contributor

Hello,

Thanks for this program, connman really needed a ncurses interface =). On line 1561 there is an assert entry:

    assert(LINES >= 24 && COLS >= 80);

Which make connman_ncurses crash (Aborted (core dumped)) if it's launched from a terminal with less than 24 lines or less than 80 cols. Instead of crashing it could output a warning stating it only support terminals larger than 24x80. My testing tput cols = 82, tput lines = 23.

Cheers.

@jobol
Copy link
Contributor

jobol commented Jan 21, 2015

Hi Javier,

Thanks for the report.

Did you tried to remove the assert ? How does it work without that assert on your 23x82 terminal?

@javier-lopez
Copy link
Contributor Author

Hi jobol,

Yes I remove it and it works fine (although it loses the right window margin), when the app is resized to even lower resolutions some of the elements start disappearing. I took some screenshots.

79x23
79x23

70x20
70x20

65x20
65x20

55x20
55x20

55x15
50x15

@alan-mushi
Copy link
Contributor

Hi,

The assert is only used to ensure that the interface works at a minimal resolution. I didn't expect your exotic resolution. If you need to use it at your resolution, you might want to modify create_win() in main.c that way you will have the entire interface. That being said, I can't assure you that the interface will always be displayed correctly: responsive-design in ncurses is a bit of a hassle!

@jobol
Copy link
Contributor

jobol commented Jan 22, 2015

I'm thinking that the current design of the application require some minimal resolution.
I can see that under 65 columns, the state of the connexion is missing.
For the bottom line, I think that it is an other problem that can be solved with reduced effort.

@chrissound
Copy link

How about a better error message for this?

Right now I get the following output which isn't very helpful...

connman-ncurses: main.c:1534: main: Assertion `LINES >= 24 && COLS >= 80' failed.
     [1]    14267 abort (core dumped)  connman-ncurses
                                                      %   

@jobol
Copy link
Contributor

jobol commented Feb 13, 2017

well well well...
at the moment, no development is possible here.
we aren't anymore part of the company eurogiciel.
we forked it on gitlab (https://gitlab.com/iotbzh/connman-json-client) but I see that other people forked the project on github.
i see that alan mushi aka thibault guittet, the main writer of connman-json-client, fixed issue 9

if developement was possible, I believe that in the wait of a future handling of very little screens, a good message should be the way to go. yes.

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

No branches or pull requests

4 participants