summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-07 21:49:11 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-07 21:49:11 +0200
commita4062924109b74635d7deacd304f18675e4038d8 (patch)
tree6f9d31d688dd68d58be1bdfdf8a3ce9142f436e9
parent43a4ad52a02dd5d1f3b564f2d2989c28c61c888e (diff)
downloadtterm-a4062924109b74635d7deacd304f18675e4038d8.tar.gz
Handle fg naively
It won't work properly at all if you run some other command in-between. The only way to properly handle this is on the shell side.
-rw-r--r--tterm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tterm.c b/tterm.c
index 015d17b..648fa5c 100644
--- a/tterm.c
+++ b/tterm.c
@@ -121,7 +121,8 @@ main(int argc, char *argv[])
XFlush(display);
} else if (strncmp(line, "cmd", 3) == 0) {
line += 3; line[len-4] = 0; /* chomp */
- snprintf(cmd, MAX_CMD, "%s (%s)", line, cwd);
+ if (strncmp(line, "fg", 2) != 0)
+ snprintf(cmd, MAX_CMD, "%s (%s)", line, cwd);
XStoreName(display, w, cmd);
XFlush(display);
} else {