blob: f743af8dc45b5f1425a291eb2f12370c13f9029a (
plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
READLINE PATCH REPORT
=====================
Readline-Release: 8.3
Patch-ID: readline83-004
Bug-Reported-by: Lennart Ackermans <lennart@ackermans.ch>
Bug-Reference-ID: <d6f36c30-633a-4e5e-8212-806db6441bf1@ackermans.ch>
Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-05/msg00066.html
Bug-Description:
If readline is invoked with the cursor somewhere other than column 0, and
the prompt contains multibyte characters, the display algorithm needs to
use a buffer offset, instead of the physical prompt length, to determine
whether or not to reprint the prompt from column 0 because the cursor is
before the last invisible character in the prompt string.
Patch (apply with `patch -p0'):
Lennart Ackermans <lennart@ackermans.ch> 5/19/2026
*** ../readline-8.3-patched/display.c Thu Sep 4 11:55:37 2025
--- display.c Fri May 22 14:55:01 2026
***************
*** 1498,1502 ****
only need to reprint it if the cursor is before the last
invisible character in the prompt string. */
- /* XXX - why not use local_prompt_len? */
nleft = prompt_visible_length + wrap_offset;
if (cursor_linenum == prompt_last_screen_line)
--- 1498,1501 ----
***************
*** 1510,1518 ****
buffer position, an index into curline
(local_prompt + pmt_offset) */
! cursor_bufpos = pmt_offset;
! if (mb_cur_max == 1 || rl_byte_oriented)
! cursor_bufpos += _rl_last_c_pos;
! else
! cursor_bufpos += _rl_last_c_pos + curline_invchars;
if (local_prompt && local_prompt_invis_chars[cursor_linenum] &&
--- 1509,1513 ----
buffer position, an index into curline
(local_prompt + pmt_offset) */
! cursor_bufpos = pmt_offset + local_prompt_len;
if (local_prompt && local_prompt_invis_chars[cursor_linenum] &&
*** ../readline-8.3/patchlevel 2013-11-15 08:11:11.000000000 -0500
--- patchlevel 2024-03-21 08:28:40.000000000 -0400
***************
*** 1,3 ****
# Do not edit -- exists only for use by patch
! 3
--- 1,3 ----
# Do not edit -- exists only for use by patch
! 4
|