summary refs log tree commit diff
path: root/home/.bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhome/.bin/hnel.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/home/.bin/hnel.c b/home/.bin/hnel.c
index bb087df1..981355a6 100755
--- a/home/.bin/hnel.c
+++ b/home/.bin/hnel.c
@@ -6,6 +6,7 @@ exec cc -Wall -Wextra -pedantic $@ -lutil -o $(dirname $0)/hnel $0
 
 #include <err.h>
 #include <poll.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
@@ -41,6 +42,7 @@ int main(int argc, char *argv[]) {
 
     if (argc < 2) return EX_USAGE;
 
+    bool enable = true;
     char table[256] = {0};
     table['n'] = 'j'; table['N'] = 'J'; table[CTRL('N')] = CTRL('J');
     table['e'] = 'k'; table['E'] = 'K'; table[CTRL('E')] = CTRL('K');
@@ -82,8 +84,13 @@ int main(int argc, char *argv[]) {
             if (len < 0) err(EX_IOERR, "read(%d)", STDIN_FILENO);
 
             if (len == 1) {
+                if (buf[0] == CTRL('S')) {
+                    enable = !enable;
+                    continue;
+                }
+
                 unsigned char c = buf[0];
-                if (table[c]) buf[0] = table[c];
+                if (enable && table[c]) buf[0] = table[c];
             }
 
             len = writeAll(master, buf, len);
=2.2&id=31a2af0c65c492b7e8ab6efaf4162aeaeb716e7f&follow=1'>Clarify /window documentationJune McEnroe 2019-02-23Use first word of params in input commandsJune McEnroe 2019-02-23Add C-n and C-p key bindings to switch windowsJune McEnroe 2019-02-23Change example command to join #ascii.town on freenodeJune McEnroe 2019-02-23Call def_prog_mode after termNoFlowJune McEnroe 2019-02-22Move IRC formatting reset to C-sJune McEnroe 2019-02-22Disable terminal flow controlJune McEnroe 2019-02-22Bind up and down arrows to scrollJune McEnroe 2019-02-22Remove topic TODOJune McEnroe 2019-02-22Add /znc commandJune McEnroe 2019-02-22Update status line after scrolling and term eventsJune McEnroe 2019-02-22Reorganize input.cJune McEnroe 2019-02-22Fix name of <raw> window in man pageJune McEnroe 2019-02-22Rename global tags with angle bracketsJune McEnroe 2019-02-22Show status window while connectingJune McEnroe 2019-02-22Reorganize UI code for the umpteenth timeJune McEnroe 2019-02-21Replace "view" with "window"June McEnroe 2019-02-21Remove ROT13June McEnroe 2019-02-21Clean up man pageJune McEnroe 2019-01-26Draw UI before connectingJune McEnroe 2019-01-25Avoid unused variable warnings with getyxJune McEnroe 2019-01-25Add GNU/Linux build instructionsJune McEnroe