title: How do I use getch from curses without clearing the screen?
body: <p>I'm learning to program in C and want to be able to type characters into the terminal while my code is running without pressing <kbd>return</kbd>. My program works, however when I call <code>initscr()</code>, the screen is cleared - even after calling <code>filter()</code>. The documentation for <code>filter</code> suggests it should disable clearing - however this is not the case for me.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;curses.h&gt;
  #include &lt;term.h&gt;
  
  int main(void) {
  
      int ch;
  
      filter();
      initscr();
      cbreak();
      noecho();
      keypad(stdscr, TRUE);
  
      while((ch = getch()) != EOF);
  
      endwin();
  
      return 0;
  }
  </code></pre>
  
  <p>Why does the above code still clearr the screen, and what could be done to fix it? </p>
  
  <p>I'm using Debian Lenny (stable) and gnome-terminal if that helps.</p>