Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15793 > unrolled thread

Re: Cursor can land before the prompt after calling beginning-of-line

Started byChet Ramey <chet.ramey@case.edu>
First post2020-01-08 09:35 -0500
Last post2020-01-08 09:35 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Cursor can land before the prompt after calling beginning-of-line Chet Ramey <chet.ramey@case.edu> - 2020-01-08 09:35 -0500

#15793 — Re: Cursor can land before the prompt after calling beginning-of-line

FromChet Ramey <chet.ramey@case.edu>
Date2020-01-08 09:35 -0500
SubjectRe: Cursor can land before the prompt after calling beginning-of-line
Message-ID<mailman.2251.1578494169.1979.bug-bash@gnu.org>
On 1/8/20 4:13 AM, Julien Palard wrote:
> It can be reproduced on Debian bullseye with bash 5.0.11 on urxvt and xterm and by a friend on MacOS with bash 3.2.57.
> 
> With this procedure I'm able to reproduce it consistently:
> 
> - Move ~/.bashrc elsewhere just to start clean
> - Start a new terminal (in my case tput cols tells it's 79 columns, beware, the bug varies according to the terminal width).
> - run `bash --norc` in it, to start clean
> - Prompt in my case is `bash-5.0$ `, beware, the bug varies according to the length of the prompt.
> - type `printf "Hello World\n                    "` (1)
> - hit the `uparrow` of your keyboard to see the printf again (2)
> - hit C-a (bash shortcut for beginning-of-line) (3)

Readline assumes it starts in column 0. If it doesn't know the physical
screen position of the cursor when it starts, it can't make correct
decisions about redisplay. Sometimes it wants to go to the beginning of
the line and redraw/erase characters, sometimes it wants to move backwards
and do it, but all these decisions assume that it knows where it is on
the line.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web