summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-10 21:09:32 -0500
committerJune McEnroe <june@causal.agency>2020-02-10 21:09:32 -0500
commit47a0bf7fc2b9a462a6b1d6e76f0b9a137cbef791 (patch)
treead54cf369cccf93f89635438a52d3727843ef505
parentSplit on <> in colorMentions (diff)
downloadcatgirl-47a0bf7fc2b9a462a6b1d6e76f0b9a137cbef791.tar.gz
catgirl-47a0bf7fc2b9a462a6b1d6e76f0b9a137cbef791.zip
Manually raise SIGINT from C-c
This allows it to still work, but makes C-z C-c insert the color code
rather than exit, and in the future, will allow pasting in text with
color codes.
-rw-r--r--ui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui.c b/ui.c
index 1e7eb26..903c4af 100644
--- a/ui.c
+++ b/ui.c
@@ -21,6 +21,7 @@
 #include <curses.h>
 #include <err.h>
 #include <errno.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -184,12 +185,13 @@ void uiHide(void) {
 	endwin();
 }
 
-// Gain use of C-q, C-s, C-z, C-y, C-o.
+// Gain use of C-q, C-s, C-c, C-z, C-y, C-o.
 static void acquireKeys(void) {
 	struct termios term;
 	int error = tcgetattr(STDOUT_FILENO, &term);
 	if (error) err(EX_OSERR, "tcgetattr");
 	term.c_iflag &= ~IXON;
+	term.c_cc[VINTR] = _POSIX_VDISABLE;
 	term.c_cc[VSUSP] = _POSIX_VDISABLE;
 	term.c_cc[VDSUSP] = _POSIX_VDISABLE;
 	term.c_cc[VDISCARD] = _POSIX_VDISABLE;
@@ -805,6 +807,7 @@ static void keyCtrl(wchar_t ch) {
 		break; case L'?': edit(id, EditDeletePrev, 0);
 		break; case L'A': edit(id, EditHead, 0);
 		break; case L'B': edit(id, EditPrev, 0);
+		break; case L'C': raise(SIGINT);
 		break; case L'D': edit(id, EditDeleteNext, 0);
 		break; case L'E': edit(id, EditTail, 0);
 		break; case L'F': edit(id, EditNext, 0);
2022-07-03Add The Bone Shard EmperorJune McEnroe 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe