From a4062924109b74635d7deacd304f18675e4038d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 7 Jun 2021 21:49:11 +0200 Subject: 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. --- tterm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 { -- cgit v1.2.3