Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-22 Thread L A Walsh
On 2022/03/20 02:20, Michaelll Lee wrote: When ``PS1’’ environment variable contains the ANSI escape codes, Bash will behavior unexpectedly when Copy&Paste the content from clipboard using Ctrl+V. This unexpected behaviour could be easily reproduced in a few steps. Reproduceable steps are: 1) $

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-21 Thread Michaelll Lee
On Mar 21, 2022, 9:39 PM Dennis Williamson wrote: > > Note that the difference you see in Bash 5 is due to new paste behavior. >From the perspective from users, would be more appropriate to see a hint for this new kind of behavior in man page/manual. Anyway, thanks for the clarification. On Mo

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-21 Thread Michaelll Lee
On Mar 21, 2022, 9:47 PM Chet Ramey wrote: > Unless told otherwise, it assumes that every character it outputs contributes > to that physical cursor position. Thank you Sir, for pointing out this clearly, and now I think my previous thoughts would be my misunderstanding. On Mon, Mar 21, 2022 at

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-21 Thread Chet Ramey
On 3/21/22 5:00 AM, Michaelll Lee wrote: While using non-printing characters without "\[...\]" proves to be fine in versions prior to 5.x.x (e.g., many suggestions from some online forums have suggested "PS1=\e[0m" for using ANSI escape code in the prompt), the same configuration in 5.x.x is not

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-21 Thread Dennis Williamson
On Mon, Mar 21, 2022 at 4:01 AM Michaelll Lee wrote: > . . . > While using non-printing characters without "\[...\]" proves to be fine in > versions prior to 5.x.x (e.g., many suggestions from some online forums > have suggested "PS1=\e[0m" for using ANSI escape code in the prompt), the > same co

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-21 Thread Greg Wooledge
On Mon, Mar 21, 2022 at 05:00:29PM +0800, Michaelll Lee wrote: > By the way, apparently the content about "non-printing characters" in that > man page has not been modified across the several versions of Bash, for > example in my machine, "3.2.57(1)-release" and "5.1.0(1)-release" share > nearly t

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-21 Thread Michaelll Lee
@Andreas Have it solved by following that manual page and using "\[ ... \]" combination. Thanks for the hint! By the way, apparently the content about "non-printing characters" in that man page has not been modified across the several versions of Bash, for example in my machine, "3.2.57(1)-releas

Re: [Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-20 Thread Andreas Schwab
On Mär 20 2022, Michaelll Lee wrote: > 1) $ PS1='---Test \\ \e[0m ---\\$ ' Read the manual about non-printing characters in the prompt. https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4

[Bug Report] The Unexpected Behavior When Using ANSI Escape Code

2022-03-20 Thread Michaelll Lee
*Below are generated automatically by **'/usr/bin/bashbug' due to the absence of 'rmail**’** command.* --- *From:* Michael(lwl2...@gmail.com) *To:* bug-bash@gnu.org *Subject: *The Unexpected Behavior When Using ANSI