Pass -+J to less to turn off the status column

With -J in $LESS, less draws a status column two characters wide on
the left, so lines that bat already wrapped to the terminal width wrap
a second time and the rest of them ends up over the line numbers.

Reset the option with -+J next to the other default less arguments and
skip it for BusyBox less like -K, since it does not support it either.
+J does not work here, less runs it as the J command on startup.

Closes #2497
This commit is contained in:
dualfroz committed 2026-10-18 13:22:24 +02:00
1 parent fcaf1acdc8
commit daa163bc7d
5 files changed
+28 -1

No files matched your search

+1
View File
@@ -25,6 +25,7 @@
- Syntax highlighting for Python files using uv as script runner in shebang #3689 (@janlarres)
## Bugfixes
- Turn off the `less` status column (`-J`, e.g. from `$LESS`) so wrapped lines no longer overlap the line numbers, closes #2497, see #4085 (@dualfroz)
- Exit quietly with status 0 instead of panicking when stdout is closed early (broken pipe) on auxiliary output paths such as `--completion`, `--config-file`, `--diagnostic`, `--generate-config-file`, `--set-terminal-title` and `cache --build`/`--clear`, matching the main output path since #232, closes #4034, see #4035 (@Mathjk)
- Track strikethrough (SGR 9 / 29) in the ANSI style tracker so it is re-emitted like bold, dim, italic, and underline, and is no longer dropped after the first highlighted token when displaying ANSI input with syntax highlighting, see #4015 (@mikehasa)
- Allow boolean flags to be given more than once, so that a flag set in the config file can also be passed on the command line without erroring, see #3912 (@logarithmone1128)