git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: \b character escapes in CLI usage

From
Jeff King <peff@peff.net>
Date
Feb 26, 2025, 08:09 UTC
Message-ID
<20250226080902.GA29996@coredump.intra.peff.net>
In-Reply-To
<20250226073822.GA21138@coredump.intra.peff.net>
On Wed, Feb 26, 2025 at 02:38:23AM -0500, Jeff King wrote:
> I wonder if we should consider adding "U" to the default $LESS variable
> we set.

Having tried this for 5 minutes, the answer is a resounding "no". It also treats tabs as control characters, making source code diffs rather ugly. ;)

In modern versions of less you can get around it with:
  LESS="-U --proc-tab"
or:
  LESS="--PROC-BACKSPACE"

but those are new in less 632, from the last year or two. So I don't think we can rely on it in our default variable, but people with recent versions of less should consider setting it.

Looks like it was added for exactly this case:
  https://github.com/gwsw/less/issues/335
-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 3 of 15 in “\b character escapes in CLI usage”
  1. Yaakov SmithFeb 25, 2025
  2. Jeff KingFeb 26, 2025
  3. Jeff KingFeb 26, 2025
  4. Junio C HamanoFeb 26, 2025
  5. Kyle LippincottFeb 26, 2025
  6. Jeff KingFeb 26, 2025
  7. Junio C HamanoFeb 26, 2025
  8. brian m. carlsonFeb 26, 2025
  9. Junio C HamanoFeb 26, 2025
  10. Junio C HamanoFeb 27, 2025
  11. General output formatting (was: Re: \b character escapes in CLI usage)Marc Branchaud, Feb 27, 2025
  12. Junio C HamanoFeb 27, 2025
  13. Marc BranchaudFeb 27, 2025
  14. Junio C HamanoFeb 27, 2025
  15. Phillip WoodFeb 27, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.