Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Chet Ramey Newsgroups: gnu.bash.bug Subject: Re: Cursor can land before the prompt after calling beginning-of-line Date: Wed, 8 Jan 2020 09:35:48 -0500 Lines: 25 Approved: bug-bash@gnu.org Message-ID: References: <6336584d-954c-6ec4-13d7-2a6e1d4e8e1b@case.edu> Reply-To: chet.ramey@case.edu NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1578494170 16717 209.51.188.17 (8 Jan 2020 14:36:10 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu To: Julien Palard , "bug-bash@gnu.org" Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1578494157; bh=dgTCZ7lWlMW6hQSe1o3yzIvbpX82jYMgMyriDPyyBGg=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=kKdB6GgYKBoqsK1w0fXLmrzBthck98FCJOKrBrHgch0+fpX2hVUn+PiPGDkHu0zs6r JtyQWahOA7vdJzeP1kDxyh80A2jEiMJV51v8Ygf007veYO1+9ZA59qBd0sdKKqqmzUe pl7qU+R+bfP/dUHippYvDUACR1MwBJL3m9JNEjTBlQu4wmeBZfkwIyHhErwYgJVGe6M E+mnHe1cZFME2w4nvDrD1ftebuJH8Qz+0FxjSAgZlLMWiO+IfgLKfPF2ObEPViGcKf/ spZIv1rIEY7tSQNd+GISeCEGSDbg6VnCNMxdo9gOrI7CS/6H1ZSQJSvhNTZ9uIZxm3Z vYZDUlOg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1578494149; bh=NgM0AlTxQaL+Affq5x/9UU/9llwPw8/g5q33Li06C4U=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=1OD20ltJZya1M4WMsXsKfQE4aFjBYiMk+R8B5EmFO3Qjj6HVkmz0CzIWO+iVgEKgjB oW0ruwbsgiZYCHuo69/KHauYhMNMYmpwxHdgIZQMkqkE7Goxu94RH20Yf2/2nHtJqGr IzrDz+pL/T5pdigUlTzrfTf/Drkbu0itKs4+zoakR2Opv6Q4hhkChnkw0I44Cf0+fdO m+6qTuIOn5nP59vyKk7mvKio/orv8eMxt7i7+tiSx4zT5ia6SP2cYBKNb8jVcgruNxy Y4xVLvnmwZXqgXFHH16ZkSAd0icwlcI/0qmhe0A/rNYyPyzK0GtPlP5FwKpXuzibGkP Cz7OY96w== User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 In-Reply-To: Content-Language: en-US X-Junkmail-Status: score=7/90, host=mpv4-2015.case.edu X-Junkmail-PrAS-Raw: score=7/90, refid=2.7.2:2020.1.8.132117:17:7.944, ip=, rules=DKIM_SIGNATURE, __HAS_REPLYTO, __HAS_CC_HDR, __SUBJ_REPLY, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __TO_MALFORMED_2, __TO_NAME, __TO_NAME_DIFF_FROM_ACC, __HAS_REFERENCES, __REFERENCES, __HAS_FROM, FROM_EDU_TLD, __HAS_MSGID, __SANE_MSGID, DATE_TZ_NA, __USER_AGENT, __MOZILLA_USER_AGENT, __MIME_VERSION, __IN_REP_TO, __CT, __CT_TEXT_PLAIN, __CTE, __REPLYTO_SAMEAS_FROM_ADDY, __REPLYTO_SAMEAS_FROM_ACC, __FROM_DOMAIN_IN_ANY_CC1, __FROM_DOMAIN_IN_ANY_CC2, __REPLYTO_SAMEAS_FROM_DOMAIN, __DKIM_ALIGNS_1, __DKIM_ALIGNS_2, __ANY_URI, __URI_MAILTO, __URI_WITH_PATH, __URI_NO_WWW, __CP_URI_IN_BODY, __FRAUD_MONEY_CURRENCY_DOLLAR, __SUBJ_ALPHA_NEGATE, __URI_IN_BODY, __URI_NOT_IMG, __MAIL_CHAIN, __FORWARDED_MSG, __BODY_NO_MAILTO, __NO_HTML_TAG_RAW, BODY_SIZE_1300_1399, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, [TRUNCATED], so=2010-03-03 19:42:08, dmn=2016-08-03-0138 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 129.22.103.195 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <6336584d-954c-6ec4-13d7-2a6e1d4e8e1b@case.edu> X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:15793 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/