When I use debug the setupterm returns -1???

Learning on my own => C++.

Been using codeblocks as my IDE on Arch Linux.

I use the following function to clear my terminal throughout my program.


1
2
3
4
5
6
7
8
9
10
11
12
13
void        Clear_Screen(bool RESET)
{
  if (!cur_term)
        {
            int result = 0;
            setupterm(NULL,STDOUT_FILENO,&result);
            if (result <=0) 
                return;
        }
        putp(tigetstr( "clear"));
        if (RESET == true)
            putp(tigetstr( "rs1"));
}


no errors building

whenever I run the program it works flawless!

When I use debug the "clear" does not perform as I would like but instead the output just scrolls.

This is because the "int result;" is returning a -1 when observed through the debugger - hence no clear.

I found that -1 is the return for "An error occurred while locating the terminfo database."

I used devilspie to find that the window open when the program is ran is called "CB_Console_Runner" and when in Debug it is called "sleep".

What is behind the no clear??

So I changed over to QT Creator IDE and found that the debug and run terms are both called QTCreator_process_stub and that in both my clear function fails to clear - compiles but as mentioned earlier result is returned as -1.

What is causing this???
Topic archived. No new replies allowed.