summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/bit.y13
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/bit.y b/bin/bit.y
index d4ca3b8e..7a7d37ed 100644
--- a/bin/bit.y
+++ b/bin/bit.y
@@ -159,6 +159,14 @@ static int yylex(void) {
 	}
 }
 
+static const char *Codes[128] = {
+	"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+	"BS",  "HT",  "NL",  "VT",  "NP",  "CR",  "SO",  "SI",
+	"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+	"CAN", "EM",  "SUB", "ESC", "FS",  "GS",  "RS",  "US",
+	[127] = "DEL",
+};
+
 static void print(uint64_t val) {
 	int bits = val > UINT32_MAX ? 64
 		: val > UINT16_MAX ? 32
@@ -172,8 +180,9 @@ static void print(uint64_t val) {
 		}
 		printf(" %#"PRIo64" 0b%s", val, bin);
 	}
-	if (val < 128 && isprint(val)) {
-		printf(" '%c'", (char)val);
+	if (val < 128) {
+		if (isprint(val)) printf(" '%c'", (char)val);
+		if (Codes[val]) printf(" %s", Codes[val]);
 	}
 	if (val) {
 		if (!(val & MASK(40))) {
9 14:25:15 -0400'>2017-06-09Add Code Tarmak 1 layoutJune McEnroe 2017-06-09Remap keys in vim for Tarmak 1 more sensiblyJune McEnroe 2017-06-07Add iTerm light profile and disable hotkeyJune McEnroe 2017-06-07Remap C-w {n,e} in vim for Tarmak 1June McEnroe 2017-06-06Rebind hnel in vim for Tarmak 1June McEnroe 2017-06-06Use C-space as tmux prefixJune McEnroe In an attempt to be layout agnostic. 2017-06-06Add Tarmak layoutsJune McEnroe From <https://github.com/sblaurock/tarmak-layouts>. 2017-05-26Rename keyboard layout ProgrammingJune McEnroe 2017-05-25Fix Library install conditionJune McEnroe 2017-05-25Revert "Remove macOS keyboard layout"June McEnroe This reverts commit ab3cd01748a4a99e6095654e03e2db35ed5b5313. 2017-05-08Fix copy mode bindings for tmux 2.4June McEnroe Incompatible change that makes no sense to me. 2017-05-02Remove option unnecessary in nvim 0.2June McEnroe 2017-05-01Reorder lines in psqlrcJune McEnroe 2017-05-01Clean up Karabiner configurationJune McEnroe 2017-05-01Fix prune script loopJune McEnroe For loop was getting one string with several paths separated by newlines. 2017-05-01Fix prune scriptJune McEnroe The for loop was overriding zsh's $path variable, causing it to not be able to find rm. 2017-05-01Clean up SSH configJune McEnroe 2017-05-01Rename colorscheme "trivial"June McEnroe 2017-05-01Update vendored pathogenJune McEnroe 2017-05-01Clean up git configJune McEnroe 2017-05-01Clean up style in xxJune McEnroe 2017-05-01Clean up style in pbdJune McEnroe 2017-05-01Use EX_OK in pbcopyJune McEnroe 2017-04-30Clean up clockJune McEnroe 2017-04-30Clean up error strings in briJune McEnroe 2017-03-18Add -u option to xxJune McEnroe 2017-03-15Fix non-string-literal-format-string in briJune McEnroe 2017-03-15Fix bri compilationJune McEnroe cc will remove the file itself just fine. Always exit in case any of the shell commands fail. 2017-03-15Use psvar for title settingJune McEnroe Prevents prompt expansion from happening on the command being run when it is set in the title. 2017-03-14Add bri brightness control scriptJune McEnroe This is probably terrible. 2017-03-14Add comment to tmux terminal overrideJune McEnroe 2017-03-13Have tmux set block cursor on linux consoleJune McEnroe 2017-03-13Use inverse for Visual in colorschemeJune McEnroe