From 0193940e50c4d5bc7ae767336598183aba6ae464 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Thu, 10 Dec 2020 23:32:22 -0700 Subject: [PATCH] client: ignore control sequence length in prompt Readline uses the characters \001 and \002 to mark the start and end of zero-length character sequnces in the prompt before prompt expansion. Without these characters the input point can become offset from the visual end of the prompt when performing some actions. --- client/display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/display.c b/client/display.c index b19759ea..88bc913f 100644 --- a/client/display.c +++ b/client/display.c @@ -39,7 +39,8 @@ #include "client/command.h" #include "client/display.h" -#define IWD_PROMPT COLOR_GREEN "[iwd]" COLOR_OFF "# " +#define IWD_PROMPT \ + "\001" COLOR_GREEN "\002" "[iwd]" "\001" COLOR_OFF "\002" "# " #define LINE_LEN 81 static struct l_signal *window_change_signal;