title: Terminating a process breaks python curses
body: <p>Using python multiprocessing and curses, it appears that terminating a Process interferes with curses display.<br>
  For example, in the following code, why does terminating the process stops curses from displaying the text ? (pressing b after pressing a)<br>
  More precisely, it seems that not only the string "hello" is not displayed anymore but also the whole curses window.</p>
  
  <pre><code>import curses
  from multiprocessing import Process
  from time import sleep
  
  def display(stdscr):
      stdscr.clear()
      curses.newwin(0,0)
      stdscr.timeout(500)
      p = None
      while True:
          stdscr.addstr(1, 1, "hello")
          stdscr.refresh()
          key = stdscr.getch()
          if key == ord('a') and not p:
              p = Process(target = hang)
              p.start()
          elif key == ord('b') and p:
              p.terminate()
  
  def hang():
      sleep(100)
  
  if __name__ == '__main__':
      curses.wrapper(display)
  </code></pre>
  
  <p>I'm running python 3.6 under GNU/Linux.</p>
  
  <p><strong>Edit :</strong><br>
  I'm still able to reproduce with this more stripped down version which doesn't call sleep(). Now just pressing "a" triggers the bug.</p>
  
  <pre><code>import curses
  from multiprocessing import Process
  
  def display(stdscr):
      stdscr.clear()
      curses.newwin(0,0)
      stdscr.timeout(500)
      p = None
      while True:
          stdscr.addstr(1, 1, "hello")
          stdscr.refresh()
          key = stdscr.getch()
          if key == ord('a') and not p:
              p = Process(target = hang)
              p.start()
              p.terminate()
  
  def hang():
      while True:
          temp = 1 + 1
  
  if __name__ == '__main__':
      curses.wrapper(display)
  </code></pre>