I'm trying to write a shell and I'm at the point where I want to ignore ctrl-c.
I currently have my program ignoring SIGINT and printing a new line when the signal comes, but how can I prevent the ^C from being printed?
When pressing ctrl-c, here is what I get:
myshell>^C
myshell>^C
myshell>^C
but I want:
myshell>
myshell>
myshell>
Here is my code relevant to ctrl-c:
extern "C" void disp( int sig )
{
printf("\n");
}
main()
{
sigset( SIGINT, disp );
while(1)
{
Command::_currentCommand.prompt();
yyparse();
}
}