bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getch always returns -1 after shell


From: jon wackley
Subject: Re: getch always returns -1 after shell
Date: Mon, 27 Jan 2003 22:01:10 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01


Thanks Thomas,

Unfortunately the problem cannot be boiled down to something simple and the minimal system has no debugger.

Thanks,
jonw

Thomas Dickey wrote:
On Mon, Jan 27, 2003 at 09:25:05PM -0500, jon wackley wrote:
  
Hi Thomas,

Yes I am using nodelay(stdscr, FALSE) to try to correct this problem. 
This seems to have no effect. I'm currently looking to determine if 
stdin is being closed or altered by the shell processing. I duped the 
stdio handles to /dev/null to see if this will change anything. If you 
have any suggestions further to this please feel free to let me know.
    

well here's a very simple example which works - a simple example that
doesn't would help focus:

#include <curses.h>

int main()
{
	int ch;

	initscr();
	raw();
	noecho();

	while ((ch = getch()) != EOF) {
		if (ch == '!') {
			endwin();
			system("sh -i");
			refresh();
		} else if (ch == '\033') {
			break;
		} else
			addch(ch);
	}
	endwin();
	return 0;
}

  


reply via email to

[Prev in Thread] Current Thread [Next in Thread]