Till Wegmüller
2024-04-07 6ca8c2ef2bffdfec8cc95c049ac3f2230dc6ca82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# DP: readline63-004 upstream patch
 
               READLINE PATCH REPORT
               =====================
 
Readline-Release: 6.3
Patch-ID: readline63-004
 
Bug-Reported-by:    Egmont Koblinger <egmont@gmail.com>
Bug-Reference-ID:    <CAGWcZk+bU5Jo1M+tutGvL-250UBE9DXjpeJVofYJSFcqFEVfMg@mail.gmail.com>
Bug-Reference-URL:    http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00153.html
 
Bug-Description:
 
The signal handling changes to bash and readline (to avoid running any code
in a signal handler context) cause the cursor to be placed on the wrong
line of a multi-line command after a ^C interrupts editing.
 
Patch (apply with `patch -p0'):
 
Index: b/display.c
===================================================================
--- a/display.c
+++ b/display.c
@@ -2677,7 +2677,8 @@ _rl_clean_up_for_exit ()
 {
   if (_rl_echoing_p)
     {
-      _rl_move_vert (_rl_vis_botlin);
+      if (_rl_vis_botlin > 0)    /* minor optimization plus bug fix */
+    _rl_move_vert (_rl_vis_botlin);
       _rl_vis_botlin = 0;
       fflush (rl_outstream);
       rl_restart_output (1, 0);