Results 1 to 4 of 4
Hi
i am using ncurses to hide keyboard input:
Code:
initscr();
noecho();
char c = '
Thread: ncurses messes up terminal after program ends
'; while (c != 0x0d) { c = getchar(); printf("*");fflush(stdout); } echo(); works ok, but ...- 10-15-2008 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 18
ncurses messes up terminal after program ends
Hi
i am using ncurses to hide keyboard input:
works ok, but after the program ends, my terminal is messed up such that itCode:initscr(); noecho(); char c = '\0'; while (c != 0x0d) { c = getchar(); printf("*");fflush(stdout); } echo();
does not echo keyboard input anymore. I first have to type 'reset' to have
it work normally again. Is there any command i have to add which ends the
settings of ncurses?
Thank You
Jody
- 10-15-2008 #2Linux Newbie
- Join Date
- Jan 2008
- Location
- UK
- Posts
- 211
Hi,
If you want to initialize and reset curses use
initscr();
....
endwin();
exit(EXIT_SUCCESS);
hope this helps
- 10-15-2008 #3Linux Newbie
- Join Date
- Jan 2008
- Location
- UK
- Posts
- 211
Hi again,
I've just been refreshing my mind as to curses and if you want to carry on in curses and reset it so it echos, use the keyboard input functions and it will be easy.
hope this is more like what you had in mind.
wowbag1
- 10-15-2008 #4Just Joined!
- Join Date
- Sep 2007
- Posts
- 18
[solved] ncurses messes up terminal after program ends
Thanks wowbag1
endwin() did the trick !
Jody


Reply With Quote