title: How to set a interface in terminal using termcap library
body: <p>I need to create a <code>interface</code> in terminal using the <code>termios.h</code> in C. To keep it short I have to create a executable like <code>./exec</code> and after I run, it has to stop displaying the <code>PS1</code> variable.
  If I have a program which displays the following text <code>Hello World</code> that uses <code>printf</code> it will look like:</p>
  
  <pre><code>$:&gt; ./exec
  Hello World!
  </code></pre>
  
  <p>But instead of printing that, I need only the <code>Hello World!</code> to be in the terminal, like when you clear the screen while the program is displaying.</p>
  
  <pre><code>Hello World!
  </code></pre>
  
  <p>To say it in other way, the purpose is to clean the terminal, and when the <code>./exec</code> is runned, it should clear this line as well, <code>$:&gt; ./exec</code>.</p>
  
  <p>So far I managed to make this function</p>
  
  <pre><code>void    clear_screen()
  {
      char buf[1024];
      char *str;
  
      tgetent(buf, getenv("TERM"));
      str = tgetstr("cl", NULL);
      fputs(str, stdout);
  }
  </code></pre>
  
  <p>Which clears the screen but it keeps the line with the command itself <code>$:&gt; ./exec</code>. I am not allowed to use <code>ncurses.h</code> library.</p>
  
  <p>Here is a main:</p>
  
  <pre><code>int main(void)
  {
      clear_screen();
      printf("Hello World!\n");
      return (0);
  }
  </code></pre>