Redimensionar problema de terminal e rolagem com ncurses

Estou programando em C usando bibliotecas ncurses (é a primeira vez) e tenho dois problemas. Estou no ubuntu com o terminal padrão (terminal gnome).

1) Eu preciso redimensionar o terminal. Eu usei resizeter () e resize_term (), mas eles falham.

2) Uso a função scrollok () e o problema é que perco as linhas roladas (quando volto com wscrl (), há linhas em branco).

#include <ncurses.h>

int main() {

WINDOW *win, *win2;

int i;
char c;

initscr();
cbreak();
noecho();

win=newwin(8,20,1,1);
box(win,0,0);
win2=newwin(6,18,2,2);
scrollok(win2,1);
wrefresh(win);
wrefresh(win);

for(i=0;i<15;i++){
    c=wgetch(win2);
    if(c=='u'){
        wscrl(win2,-1);
        wrefresh(win2);
    }
    else{
        wprintw(win2,"%c\n",c);
        wrefresh(win2);
    }
}

delwin(win);
delwin(win2);
endwin();

return 0;
}

questionAnswers(3)

yourAnswerToTheQuestion