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 was reading about how to change the text color in console programaticly and I was introduced to terminal escape sequences. One thing I read is that it is not portable. How portable is it? I heard ncurses is more portable.
My porpose is to design programs that should be runnable on unix machine ( which works and I'm happy) for the future when I come back to escape sequences and changing color of console I would like to know how portable is it for me to decide how much effort I'll put in to learn ncurses.
I was reading about how to change the text color in console programaticly and I was introduced to terminal escape sequences. One thing I read is that it is not portable. How portable is it? I heard ncurses is more portable.
I would go as far as to say that ANSI/VT100 are solid standards, and would be more portable than the BSD curses (with which I think ncurses is backwards-compatible) standard (if you want to call it a standard). For example, on a stripped-down, lean, headless, embedded computer I would not expect to have (n)curses installed. But if I pull out my Serial Console/VT100 Emulator, I get colors (since the actual bytes are meant to be interpreted by the console and the computer (kernel) itself knows nothing about the colors).
Curses, however, is included with almost any modern unix on which you might possibly find it useful. Curses definitely wins the maintenance and readability contest. It might be easier to use once you get used to it (and might be easier to port when/if you decide that in addition to just colors, you want your program to take key-based input or use console-style dialogs, etc).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.