Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Robert Elz
Date:Thu, 7 Sep 2023 13:46:08 -0500 From:Eric Blake Message-ID: | Right now, both bash and coreutils' 'printf %hhd 257' outputs "257", ok, not unexpected. I'm not sure its useful either. | but printf("%hhd", 257) in C outputs 1. Yes. | I would LOVE to ha

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Pádraig Brady
On 07/09/2023 19:46, Eric Blake wrote: On Thu, Sep 07, 2023 at 11:53:54PM +0700, Robert Elz wrote: And for those who have been following this issue, the new text for the forthcoming POSIX version has removed any mention of obsoleting %b from printf(1) - instead it will simply note that there is

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Zachary Santer
On Thu, Sep 7, 2023 at 12:55 PM Robert Elz wrote: > There are none, printf(3) belongs to the C committee, and they can make > use of anything they like, at any time they like. > > The best we can do is use formats that make no sense for printf(1) to > support > That's still assuming the goal of

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Eric Blake
On Thu, Sep 07, 2023 at 02:42:16PM +0700, Robert Elz wrote: > Date:Wed, 6 Sep 2023 11:32:32 -0500 > From:Eric Blake > Message-ID: > > > | You (anyone reading this, not just kre) are welcome to join tomorrow's > | Austin Group meeting > > Thanks, but I don't exp

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Eric Blake
On Thu, Sep 07, 2023 at 11:53:54PM +0700, Robert Elz wrote: > And for those who have been following this issue, the new text for > the forthcoming POSIX version has removed any mention of obsoleting > %b from printf(1) - instead it will simply note that there is will be > a difference between print

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Robert Elz
And for those who have been following this issue, the new text for the forthcoming POSIX version has removed any mention of obsoleting %b from printf(1) - instead it will simply note that there is will be a difference between printf(1) and printf(3) once the latter gets its version of %b specified

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread alex xmb ratchev
On Thu, Sep 7, 2023, 17:41 Kerin Millar wrote: > On Thu, 7 Sep 2023 17:33:45 +0200 > alex xmb ratchev wrote: > > > On Thu, Sep 7, 2023, 16:51 Kerin Millar wrote: > > > > > On Thu, 7 Sep 2023 15:53:03 +0200 > > > alex xmb ratchev wrote: > > > > > > > On Thu, Sep 7, 2023, 15:46 Gioele Barabucci

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Kerin Millar
On Thu, 7 Sep 2023 17:33:45 +0200 alex xmb ratchev wrote: > On Thu, Sep 7, 2023, 16:51 Kerin Millar wrote: > > > On Thu, 7 Sep 2023 15:53:03 +0200 > > alex xmb ratchev wrote: > > > > > On Thu, Sep 7, 2023, 15:46 Gioele Barabucci wrote: > > > > > > > On 07/09/23 15:00, alex xmb ratchev wrote:

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread alex xmb ratchev
On Thu, Sep 7, 2023, 16:51 Kerin Millar wrote: > On Thu, 7 Sep 2023 15:53:03 +0200 > alex xmb ratchev wrote: > > > On Thu, Sep 7, 2023, 15:46 Gioele Barabucci wrote: > > > > > On 07/09/23 15:00, alex xmb ratchev wrote: > > > > u have to \[ esc-seq \] > > > > eg inside \[ and \] > > > > > > > >

Re: key "x" doesn't print out the "x", only "CTRL-V x" does.

2023-09-07 Thread Chet Ramey
On 9/7/23 8:17 AM, detlef.bier...@posteo.de wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release Description: When pressing the "x" key, no letter appears, with the combination "CTRL-v x" the "x" appears. The key only works in bash, in sh, in the X server as well, in all graphic

Re: command substitution when timing grouped commands fails

2023-09-07 Thread Kerin Millar
On Thu, 07 Sep 2023 05:50:49 -0700 hacke...@member.fsf.org wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat > -Werror=format-security -Wall > uname output:

Re: give_terminal_to() / maybe_give_terminal_to() race

2023-09-07 Thread Earl Chew
On 2023-09-05 08:46, Chet Ramey wrote: Such as? If the parent doesn't need to change the terminal process group, synchronizes with the pipeline via waitpid(), and doesn't attempt to change the terminal process group back until all children in that process group have stopped or exited, what conseq

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Kerin Millar
On Thu, 7 Sep 2023 15:53:03 +0200 alex xmb ratchev wrote: > On Thu, Sep 7, 2023, 15:46 Gioele Barabucci wrote: > > > On 07/09/23 15:00, alex xmb ratchev wrote: > > > u have to \[ esc-seq \] > > > eg inside \[ and \] > > > > > > PS1=$'\u\[\e[1m\]\h\[\e[0m- ' > > > > > > should display hostname b

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Gioele Barabucci
On 07/09/23 16:24, Gioele Barabucci wrote: On 07/09/23 16:15, Greg Wooledge wrote: On Thu, Sep 07, 2023 at 04:03:39PM +0200, Gioele Barabucci wrote: The following snippet shows that, even with the final \], Bash produces the same erroneous output and miscalculates the cursor position (it just

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread alex xmb ratchev
On Thu, Sep 7, 2023, 16:26 Andreas Kähäri wrote: > On Thu, Sep 07, 2023 at 04:03:39PM +0200, Gioele Barabucci wrote: > > On 07/09/23 15:50, Greg Wooledge wrote: > > > On Thu, Sep 07, 2023 at 03:46:23PM +0200, Gioele Barabucci wrote: > > > > On 07/09/23 15:00, alex xmb ratchev wrote: > > > > > u h

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Andreas Kähäri
On Thu, Sep 07, 2023 at 04:03:39PM +0200, Gioele Barabucci wrote: > On 07/09/23 15:50, Greg Wooledge wrote: > > On Thu, Sep 07, 2023 at 03:46:23PM +0200, Gioele Barabucci wrote: > > > On 07/09/23 15:00, alex xmb ratchev wrote: > > > > u have to \[ esc-seq \] > > > > eg inside \[ and \] > > > > > >

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Gioele Barabucci
On 07/09/23 16:15, Greg Wooledge wrote: On Thu, Sep 07, 2023 at 04:03:39PM +0200, Gioele Barabucci wrote: The following snippet shows that, even with the final \], Bash produces the same erroneous output and miscalculates the cursor position (it just needs a longer prompt): $ long_name="$(

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Greg Wooledge
On Thu, Sep 07, 2023 at 04:03:39PM +0200, Gioele Barabucci wrote: > The following snippet shows that, even with the final \], Bash produces the > same erroneous output and miscalculates the cursor position (it just needs a > longer prompt): > > $ long_name="$(printf 'abcdef0123456789/%.0s' {0.

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Gioele Barabucci
On 07/09/23 15:50, Greg Wooledge wrote: On Thu, Sep 07, 2023 at 03:46:23PM +0200, Gioele Barabucci wrote: On 07/09/23 15:00, alex xmb ratchev wrote: u have to \[ esc-seq \] eg inside \[ and \] PS1=$'\u\[\e[1m\]\h\[\e[0m- ' should display hostname bold Thanks for the suggestion, but adding \

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread alex xmb ratchev
On Thu, Sep 7, 2023, 15:46 Gioele Barabucci wrote: > On 07/09/23 15:00, alex xmb ratchev wrote: > > u have to \[ esc-seq \] > > eg inside \[ and \] > > > > PS1=$'\u\[\e[1m\]\h\[\e[0m- ' > > > > should display hostname bold > > Thanks for the suggestion, but adding \] does not really fix the > pro

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Greg Wooledge
On Thu, Sep 07, 2023 at 03:46:23PM +0200, Gioele Barabucci wrote: > On 07/09/23 15:00, alex xmb ratchev wrote: > > u have to \[ esc-seq \] > > eg inside \[ and \] > > > > PS1=$'\u\[\e[1m\]\h\[\e[0m- ' > > > > should display hostname bold > > Thanks for the suggestion, but adding \] does not real

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Gioele Barabucci
On 07/09/23 15:00, alex xmb ratchev wrote: u have to \[ esc-seq \] eg inside \[ and \] PS1=$'\u\[\e[1m\]\h\[\e[0m- ' should display hostname bold Thanks for the suggestion, but adding \] does not really fix the problem, it just masks it in many cases (better than nothing). Try: $ long_nam

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Zachary Santer
The trouble with using an option flag to printf(1) to toggle the meaning of %b is that you can't then mix format specifiers for binary literals and backslash escape expansion within the same format string. You'd just have to call printf(1) multiple times, which largely defeats the purpose of a form

command substitution when timing grouped commands fails

2023-09-07 Thread hackerb9
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux abyssal 6.4.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1 (2023-08-17)

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread alex xmb ratchev
sorry \] missing bug PS1=$'\u\[\e[1m\]\h\[\e[0m\]- ' On Thu, Sep 7, 2023, 15:00 alex xmb ratchev wrote: > u have to \[ esc-seq \] > eg inside \[ and \] > > PS1=$'\u\[\e[1m\]\h\[\e[0m- ' > > should display hostname bold > > On Thu, Sep 7, 2023, 14:55 Gioele Barabucci wrote: > >> Bash 5.2.15 (De

Re: Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread alex xmb ratchev
u have to \[ esc-seq \] eg inside \[ and \] PS1=$'\u\[\e[1m\]\h\[\e[0m- ' should display hostname bold On Thu, Sep 7, 2023, 14:55 Gioele Barabucci wrote: > Bash 5.2.15 (Debian 12) will produce erroneous output when PS1 contains > escape sequences. It will also misplace the cursor and corrupt t

Prompt messed up if PS1 contains ANSI escape sequences

2023-09-07 Thread Gioele Barabucci
Bash 5.2.15 (Debian 12) will produce erroneous output when PS1 contains escape sequences. It will also misplace the cursor and corrupt the state of the current line. To replicate this issue: 1. Modify PS1 to contain one or more ANSI escape sequences, for example "\e[45m" (tput setab 5, change

key "x" doesn't print out the "x", only "CTRL-V x" does.

2023-09-07 Thread detlef . bieritz
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux db2 5.15.0-83-g

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Robert Elz
Date:Wed, 6 Sep 2023 11:03:25 -0500 From:Eric Blake Message-ID: | If we do nothing now for Issue 8, then Issue 9 WILL have a conflict | between printf(1) and printf(3). Yes. | If we reach out to all developers now, we can start the discussion, That would be

Re: [PATCH] printf: add %#s alias to %b

2023-09-07 Thread Robert Elz
Date:Wed, 6 Sep 2023 11:32:32 -0500 From:Eric Blake Message-ID: | You (anyone reading this, not just kre) are welcome to join tomorrow's | Austin Group meeting Thanks, but I don't expect its time of day will coincide with mine this week, at best I would be a ha