about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--xxxterm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xxxterm.c b/xxxterm.c
index dcbc1e6..e88c00f 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -905,6 +905,17 @@ cmd_history_add(char *l)
 	if (l == NULL)
 		return;
 
+	/* don't add the same line */
+	c = TAILQ_FIRST(&chl);
+	fprintf(stderr, "c %p\n", c);
+	if (c) {
+		fprintf(stderr, "s %s %s\n", c->line, l);
+		if (!strcmp(c->line + 1 /* skip : */, l)) {
+			fprintf(stderr, "skip %s %s\n", c->line, l);
+			return;
+		}
+	}
+
 	c = g_malloc0(sizeof *c);
 	c->line = g_strdup_printf(":%s", l);