ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have found out that different terminals (GUI mode) deal with curses apllications in different ways.
The problem is that some of them (eterm, gnome term, KDE) restore the view of the window
to the previous state after any curses application has completed. So the user is not able to see any output results. Only xterm doesn't do this.
How can I deal with this? Some terminal option should be set to prevent this?
I dont know why, but I think this happens as soon as endwin(). Try to chage terminal properties back to the original one without using endwin(). You may find your answer by reading the source (I coudn't fingure out the code!!)
Originally posted by Mohsen
[B]I dont know why, but I think this happens as soon as endwin(). Try to chage terminal properties back to the original one without using endwin(). You may find your answer by reading the source (I coudn't fingure out the code!!)
Thank U for the answer.
Yes, if I comment out the endwin() call, the screen isn't restoring, but the terminal doesn't get the correct mode after the program ends. I was wondering mostly, because endwin() behavior on some terminals isn't compliant with documentation. Probably, endwin() use some terminal dependent code (set/restore some terminal flags). I'll take a look into sources and try to figure out.
Last edited by dimm_coder; 04-07-2004 at 01:37 AM.
Thanks, arvind, for your answer.
Well, that was a program I had to rewrite in some parts. This program used the ncurses library for achieving a coloring output.
It had some drawbacks: 1) that one with terminals I have pointed above; 2) the program may have a long output and, thus, another problem with scrolling. So I've rewrote it using the screen output with escape sequences, not using ncurses. That solved all problems.
At any rate, thanks for advice.
Last edited by dimm_coder; 05-10-2004 at 02:48 AM.
Thanks, arvind, for your answer.
Well, that was a program I had to rewrite in some parts. This program used the ncurses library for achieving a coloring output.
It had some drawbacks: 1) that one with terminals I have pointed above; 2) the program may have a long output and, thus, another problem with scrolling. So I've rewrote it using the screen output with escape sequences, not using ncurses. That solved all problems.
At any rate, thanks for advice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.