summary refs log tree commit diff
path: root/term.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-22 23:31:33 -0500
committerJune McEnroe <june@causal.agency>2019-02-22 23:31:33 -0500
commitfacc3aa9a0b56b04c18e56418c7ea00947993f9e (patch)
tree51f2dd7c51344dd9dbf10999164ce4dac10525d0 /term.c
parentBind up and down arrows to scroll (diff)
downloadcatgirl-facc3aa9a0b56b04c18e56418c7ea00947993f9e.tar.gz
catgirl-facc3aa9a0b56b04c18e56418c7ea00947993f9e.zip
Disable terminal flow control
This opens up C-o, C-q and C-s for key bindings without C-v.
Diffstat (limited to 'term.c')
-rw-r--r--term.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/term.c b/term.c
index 75380ea..fea68ad 100644
--- a/term.c
+++ b/term.c
@@ -18,6 +18,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <termios.h>
+#include <unistd.h>
 
 #include "chat.h"
 
@@ -28,6 +30,15 @@ void termInit(void) {
 	xterm = term && !strncmp(term, "xterm", 5);
 }
 
+void termNoFlow(void) {
+	struct termios attr;
+	int error = tcgetattr(STDIN_FILENO, &attr);
+	if (error) return;
+	attr.c_iflag &= ~IXON;
+	attr.c_cc[VDISCARD] = _POSIX_VDISABLE;
+	tcsetattr(STDIN_FILENO, TCSANOW, &attr);
+}
+
 void termTitle(const char *title) {
 	if (!xterm) return;
 	printf("\33]0;%s\33\\", title);
href='/cgit-pink/commit/shared.c?id=c4ef667961ef4668c9449124f97d55b9ac46c059&follow=1'>Add standard interface for file diff functionsLars Hjemli 2007-05-13Show number of changed files in log viewLars Hjemli 2007-05-13Use standard tree-diff function when showing diffstat for single commitLars Hjemli 2007-05-13Add shared diff-handling functionsLars Hjemli 2007-05-12css: fix bad rendering in Internet ExplorerLars Hjemli 2007-05-11Add links to enable downloading of tagged blobsLars Hjemli 2007-05-11Makefile: add support for building w.o. preinstalled gitLars Hjemli 2007-05-11Tag release v0.3Lars Hjemli 2007-05-11Update README with submodule build infoLars Hjemli 2007-05-11Add submodule links in tree listingLars Hjemli 2007-05-11Add submodules.sh and use it during buildsLars Hjemli 2007-05-11Added git as a submoduleLars Hjemli 2007-05-09Add support for downloading single blobsLars Hjemli 2007-05-08ui-view: show pathname if specified in querystringLars Hjemli 2007-05-08Update to libgit 1.5.2-rc2Lars Hjemli 2007-02-21Layout updateLars Hjemli 2007-02-08Make snapshot feature configurableLars Hjemli 2007-02-08Add support for snapshotsLars Hjemli 2007-02-05cgit v0.2Lars Hjemli 2007-02-05Add support for prefix and gitsrc arguments to 'make'Lars Hjemli 2007-02-04Update cgitrc templateLars Hjemli 2007-02-04Add support for lightweight tagsLars Hjemli 2007-02-04Read repo-info from /etc/cgitrcLars Hjemli 2007-02-04Do not die if tag has no messageLars Hjemli 2007-02-03Fix search for non-virtual urlsLars Hjemli 2007-01-28Update README with install/config informationLars Hjemli