From 2feaa8545dbc8b422d34412698262b3dc860653c Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 17 Jul 2016 15:02:44 +0000 Subject: [PATCH 1/2] For multiline prompt (do control chars first). Kensuke Iwahashi/David Kaspar: set prompt="%~\n%%" ctrl-p, ctrl-u --- tc.nls.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tc.nls.c b/tc.nls.c index 6158097..60ce2f7 100644 --- a/tc.nls.c +++ b/tc.nls.c @@ -143,6 +143,13 @@ NLSClassify(Char c, int nocomb, int drawPrompt) if (c >= 0x10000) /* U+10000 = F0 90 80 80 */ return NLSCLASS_ILLEGAL2; } + if (Iscntrl(c) && (c & CHAR) < 0x100) { + if (c == '\n') + return NLSCLASS_NL; + if (c == '\t') + return NLSCLASS_TAB; + return NLSCLASS_CTRL; + } w = NLSWidth(c); if (drawPrompt) { /* draw prompt */ if (w > 0) @@ -152,12 +159,5 @@ NLSClassify(Char c, int nocomb, int drawPrompt) } if ((w > 0 && !(Iscntrl(c) && (c & CHAR) < 0x100)) || (Isprint(c) && !nocomb)) return w; - if (Iscntrl(c) && (c & CHAR) < 0x100) { - if (c == '\n') - return NLSCLASS_NL; - if (c == '\t') - return NLSCLASS_TAB; - return NLSCLASS_CTRL; - } return NLSCLASS_ILLEGAL; } -- 2.5.5 From 7fe5e55b5ebf819fad8f3571bbc008b2983882de Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 17 Jul 2016 15:03:34 +0000 Subject: [PATCH 2/2] mention multi-line prompt fix. --- Fixes | 1 + 1 file changed, 1 insertion(+) diff --git a/Fixes b/Fixes index ce17ff9..fc7ba77 100644 --- a/Fixes +++ b/Fixes @@ -1,3 +1,4 @@ + 14. Fix drawing issu with multi-line prompt (Kensuke Iwahashi/David Kaspar) 13. always send prusage to stdout. 12. PR/526: Fix double \\ printing from previous fix in history expansion. 10. PR/526: Quote backslashes properly so they can be preserved in `` -- 2.5.5