Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
<SOLVED>NCURSES not working properly from within IDE?
The following code compiles and runs within the QTC IDE but does not clear screen.
using namespace std;
void Clear_Screen(bool RESET= true);
cout << "Hello World!" << endl;
cout << "Hello Again!" << endl;
void Clear_Screen(bool RESET)
if (result <=0) return;
if (RESET == true)
As above After succesful compile the run from inside QTC gives
When run straight from XTerm result is
debug shows "result" with value -1.
Is it the way that QTC opens the application that is causing this error??
After some research i believe the TTY being applied by running it from inside QTC and directly from xterm are diff???
setupterm() the way you have used it requires the presence of a TERM environment variable which in all likelihood is absent.
You will also need to set "Run in Terminal" in your project settings in order to get a Curses compatible terminal (the Output Pane in Qt Creator is not).
Thanks for your response.
Already have "Run in Terminal" selected.
bq. setupterm() the way you have used it requires the presence of a TERM environment variable which in all likelihood is absent.
so what is the difference between running inside the IDE (absent) vs opening it directly from XTerm (present)??
The environment you have told Qt Creator to pass to your program does not contain a TERM environment variable, so one is not present.
Xterm establishes an environment for its child processes that contains the TERM variable.
Where am I telling QTC to pass this environment and can I change it so that running the application works correctly from inside the IDE??
I am assuming that QTC calls on like a shell program that opens the current project with one or two parameters like the one that
" Press <return> to close this window" comes from.
If the program can not be run properly from within the IDE I can not see how this would be a bug?
The environment settings are in the same place as the "Run in terminal" option. It is fully configurable with several presets that you can work from.
So are you saying that there is an environment setting or parameter that I need to set for this small application to work correctly from within the ide? I would love to know what it is!
It would appear that you have to insert TERM into your RUN ENVIRONMENT by clicking on ADD. Then give it the value of XTERM.