You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When viewing files with windows line endings (CRLF), less -w shows carriage return ^M in blank lines. Lines which are not empty display correctly, skipping the carriage returns. Without the -w option the ^M are omitted in blank lines too.
The same happens for -W. Adding -r removes the markers but is a rather unacceptable workaround.
$ printf'A\r\n\r\nB\r\n'| LESS= less -F
A
B
$ printf'A\r\n\r\nB\r\n'| LESS= less -Fw
A
^M
B
$ printf'A\r\n\r\nB\r\n'| LESS= less -Fwr
A
B
When text is long enough to scroll down and then back up, the ^M disappear. So, these are only shown in the newly printed lines.
$ for((i=0; i<40; i++));doprintf'A\r\n\r\nB\r\n';done| LESS= less -w
(lines scrolled back to)
A
B
(freshly printed lines)
A
^M
B
Tested with git 2.43.0.windows.1, bash 5.2.21(1), less 643.
The text was updated successfully, but these errors were encountered:
I have noticed a potential bug in less.
When viewing files with windows line endings (CRLF),
less -w
shows carriage return^M
in blank lines. Lines which are not empty display correctly, skipping the carriage returns. Without the-w
option the^M
are omitted in blank lines too.The same happens for
-W
. Adding-r
removes the markers but is a rather unacceptable workaround.When text is long enough to scroll down and then back up, the
^M
disappear. So, these are only shown in the newly printed lines.Tested with git 2.43.0.windows.1, bash 5.2.21(1), less 643.
The text was updated successfully, but these errors were encountered: