about summary refs log tree commit diff
path: root/ui.c
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 /ui.c
parentSplit on <> in colorMentions (diff)
downloadtest-47a0bf7fc2b9a462a6b1d6e76f0b9a137cbef791.tar.gz
test-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.
Diffstat (limited to 'ui.c')
-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);
'> 2018-09-28Make sans6x8 double quote narrowerJune McEnroe 2018-09-28Add greek glyphs to sans6x8June McEnroe 2018-09-28Add png target in etc/psfJune McEnroe 2018-09-28Disable visual bell in light terminal profileJune McEnroe 2018-09-28Add psf2pngJune McEnroe 2018-09-27Add HJKL for moving glyphs to psfedJune McEnroe 2018-09-27Move psfed paste to edit modeJune McEnroe 2018-09-27Export PWDJune McEnroe Without it, $(PWD) is unset in GNU make. 2018-09-27Add sans6x8 PSF2 fontJune McEnroe 2018-09-26Add copy paste to psfedJune McEnroe 2018-09-25Add r to psfed for invertJune McEnroe 2018-09-24Add psfed, a PSF2 font editorJune McEnroe 2018-09-21Add scheme -i to swap white and blackJune McEnroe 2018-09-21Map caps lock to escape on Linux consoleJune McEnroe 2018-09-19Fix README mandoc lintsJune McEnroe 2018-09-19Un-NOT trans.alpha values in pngoJune McEnroe 2018-09-18Refactor reads in pngo and clear palette between filesJune McEnroe 2018-09-17Add tRNS support to pngoJune McEnroe 2018-09-11Move gfx man pages to gfx/manJune McEnroe 2018-09-11Move bin man pages to bin/manJune McEnroe 2018-09-11Rewrite gfx.7 and render plaintext READMEJune McEnroe 2018-09-11Remove GAMES from BINSJune McEnroe 2018-09-11Rewrite bin.7 and render to plaintext READMEJune McEnroe 2018-09-11Add "blank" lines to man pagesJune McEnroe 2018-09-10Add mdoc syntax fileJune McEnroe 2018-09-08Fix Nm usage in multi-name man pagesJune McEnroe 2018-09-08Put real dates on man pagesJune McEnroe 2018-09-08Replace gfx README with REAMDE.7June McEnroe 2018-09-08Link gfx man pages in ~/.localJune McEnroe