diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-12 13:05:54 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-12 13:05:54 +0200 |
commit | abc2efa5cc903071602bf78440dde3e6c8ebe776 (patch) | |
tree | 4695482c1a1cca23db2aab4285840d19ffe549a4 | |
parent | 88f2e0d88c7571a0362cb864ce8b88242865aa39 (diff) | |
download | tterm-master.tar.gz |
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | tterm.c | 7 | ||||
-rw-r--r-- | u.c | 11 |
3 files changed, 19 insertions, 5 deletions
@@ -1,8 +1,8 @@ CFLAGS != pkg-config --cflags x11 LDFLAGS != pkg-config --libs x11 -CFLAGS += -O2 +CFLAGS += -O2 -Wall -pedantic -tterm: tterm.c +all: tterm u install: - install tterm /usr/local/bin + install tterm u /usr/local/bin @@ -10,7 +10,7 @@ #include <X11/Xlib.h> /* configuration */ -#define ARGV "xterm", "xterm", "-e", "/usr/local/bin/ksh", "-w", fifo +#define ARGV "xterm", "xterm", "-e", "u", "/usr/local/bin/ksh", "-w", fifo #define MAX_CMD 1000 #define MAX_LOOK 1000 @@ -66,7 +66,7 @@ cwdcpy(char *path) } int -main(int argc, char *argv[]) +main() { char *cwd, *cmd, *line, *fifo; FILE *fifofp; @@ -96,6 +96,9 @@ main(int argc, char *argv[]) pidatom = XInternAtom(display, "_NET_WM_PID", 0); if (pidatom == None) die("no _NET_WM_PID atom found\n"); + /* use ISO8859-1 encoding to speed up xterm start */ + setenv("LC_ALL", "en_US.ISO8859-1", 1); + /* start terminal */ if ((child = vfork()) == 0) { execlp(ARGV, NULL); @@ -0,0 +1,11 @@ +#include <err.h> +#include <unistd.h> + +int +main(int argc, char *argv[]) +{ + /* Enable UTF-8 encoding in xterm. */ + write(0, "\033%G", 3); + execvp(argv[1], argv+1); + err(1, "execvp"); +} |