title: C How to return screen to normal after curses program ends
body: <p>I'm still new to C and ncurses. I was asked to do an assignment that involved making a multithreaded pong game. The game runs fine and ends with the correct lossing conditions but upon termination my terminal is all messed up. I get no echo, so I have to type <code>stty echo</code> to get that back, even then the terminal behaves strangely. </p>
  
  <p>My end function is the following:</p>
  
  <pre><code>void wrap_up(){
  
      curs_set(1);
      clear();
      endwin();
      refresh();
  }
  </code></pre>
  
  <p>Here is a screenshot. How do I fix it?</p>
  
  <p><img src="https://i.stack.imgur.com/PNC7M.jpg" alt="enter image description here"></p>