[elinks-users] Ctrl-C -- possible to make it not quit ELinks?

Kalle Olavi Niemitalo kon at iki.fi
Sat Mar 1 14:31:54 MST 2008


Jonas Fonseca <fonseca at diku.dk> writes:

> Ctrl-C is sadly hardcoded deep down in the code and thus does not allow
> this keycombo to be overwritten.

The following patch for ELinks 0.11.4rc0 attempts to prevent
Ctrl-C from causing SIGINT while ELinks is using the terminal.
I am not going to push it to Git, but it may be useful for people
who want this behaviour.

diff --git a/src/terminal/kbd.c b/src/terminal/kbd.c
index d72aab5..1b6a4f7 100644
--- a/src/terminal/kbd.c
+++ b/src/terminal/kbd.c
@@ -220,6 +220,7 @@ setraw(int fd, struct termios *p)
 	if (p) copy_struct(p, &t);
 
 	elinks_cfmakeraw(&t);
+	t.c_cc[VINTR] = _POSIX_VDISABLE;
 	t.c_lflag |= ISIG;
 #ifdef TOSTOP
 	t.c_lflag |= TOSTOP;


More information about the elinks-users mailing list