title: Ncurses not scrolling stdscr, causing abnormal terminal behavior
body: <p>In the example below, I take in a command line arg that is assumed to be a valid .txt file, and output it to the screen in function.cpp. It reads and outputs just fine - even if the content is longer than the terminal height. But scrolling doesn't work, and Ncurses documentation is either nonexistant or horrible.<br>
  <strong>Summary:</strong> I can run the code below, but it just breaks the terminal and I have to force quit.  </p>
  
  <pre><code>void printFile(char fileName[]) {
    string line;
    string cantOpen = "Unable to open file.";
    int key;
  
    ifstream file;       //Stream to read from
    file.open(fileName); //Specify file to open/read
  
    initscr();
    scrollok(stdscr, TRUE);  //These lines are the ones I think are causing issues
    idlok(stdscr, TRUE);     //&lt;&lt;&lt;
    keypad(stdscr, TRUE);    //&lt;&lt;&lt;
  
    if(file.is_open()) {
      while(getline(file, line)) {  //Read file and output it (working fine)
        addstr(line.c_str());
        addch('\n');
        refresh();
      }
      file.close();
    } else {
      addstr(cantOpen.c_str());  //Inform user file wasn't opened
      refresh();
    }
  
    key = getch();
    if(key == KEY_SF) {            //Scroll down
      wscrl(stdscr, 1);
    } else if(key == KEY_SR) {     //Scroll up
      wscrl(stdscr, -1);
    } else if(key == KEY_ENTER) {  //Enter to exit
      endwin();
    }
  }  
  </code></pre>
  
  <p><strong>Things I've tried:</strong>  </p>
  
  <ul>
  <li>Using scrl(stdscr, x) instead of wscrl(...)  </li>
  <li>Not checking for specific key strokes to perform up or down or exit  </li>
  <li>Tried finding any examples of scrolling the stdscr that don't just link back to the documentation</li>
  </ul>
  
  <p><strong>Any ideas why scrolling isn't working as I see it described in documentation?</strong></p>