Re: [PATCH v3 0/6] use the pager in 'add -p'
- From
- Dragan Simic <dsimic@manjaro.org>
- Date
- Jun 9, 2024, 07:57 UTC
- Message-ID
- <7937845d7cb7ae0179c4922ed154c5c7@manjaro.org>
- In-Reply-To
- <219a195c-74d0-4c21-bf54-0752bb5b01df@gmail.com>
Hello Ruben,
On 2024-06-09 09:44, Rubén Justo wrote:
Show 10 quoted lines
> Some concerns were raised about controlling when to send coloring > escape > sequences. Several ideas were discussed to address this, including > introducing a new command ">", a modifier for "|": "||", and others. > Alternatively, we could leave it up to the user to filter as needed. > Or, simply, do not send escape codes at all. > > So, looking back at the ideas discussed in the thread, perhaps a > reasonable next step might be to reintroduce the 'P<program>' command > and let '|<program>' be the way to send raw, uncolored, chunks.
Actually, it would be better to re-introduce the "P" option, without any parameters, which would display the current hunk through the already configured pager, and let "|<program>" be the new option that pipes hunks _without_ coloring escape sequences to "<program>".
As a follow-up, after the dust settles, we could add "><program>" as another new option that pipes hunks _with_ the coloring escape sequences to "<program>". That would be a rather clean approach, which would also reserve the "weird-looking" commands with additional parameters (i.e. "|<program>" and "><program>") for the more advanced operations, while the "normal-looking" command (i.e. "P") would be assigned to the, presumably, most commonly used new hunk operation.