From f643975941a5fc2e24d345b2e9ea67cccc3f1dd1 Mon Sep 17 00:00:00 2001 From: jfreegman Date: Sat, 23 Jan 2021 21:17:46 -0500 Subject: [PATCH] Fix bug preventing the /clear command from working in Home window --- src/prompt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/prompt.c b/src/prompt.c index 309e6d5..0083ef7 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -286,7 +286,10 @@ static bool prompt_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr) if (wcs_to_mbs_buf(line, ctx->line, MAX_STR_SIZE) == -1) { line_info_add(self, false, NULL, NULL, SYS_MSG, 0, RED, " * Failed to parse message."); } else { - line_info_add(self, false, NULL, NULL, PROMPT, 0, 0, "%s", line); + if (strcmp(line, "/clear") != 0) { + line_info_add(self, false, NULL, NULL, PROMPT, 0, 0, "%s", line); + } + execute(ctx->history, self, m, line, GLOBAL_COMMAND_MODE); } }