less -r results in stripping first screenful of lines.
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.1.5
- OS version: 10.12.6
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window) com.googlecode.iterm2.plist
- Attach a debug log, if possible. debuglog.txt
- Are you reporting a performance issue or a hang? Please attach a sample. Instructions at https://gitlab.com/gnachman/iterm2/wikis/HowToSample
- Are you reporting a crash? Please attach the crash log. Instructions at https://gitlab.com/gnachman/iterm2/wikis/crash-logs
- Create a file with long lines, e.g. in bash:
while [ $cntr -lt 1000 ]; do echo "$cntr adsf asdf asdf asdf asdf asd fasd fasd fasdf ajsdf;lkj asdf;lkj;asdf asdfasdf asdf asdf asdf asd fasd asdfg hga dfgh dfgh dsfh dfgh adsf a sdf as fd sdfgsdf h sdfgh adfg adf g h sdhfsdf hh h sdfg dsfs s h hdf sxf s s d ssfdghhhj s ssjl; sdfg;lkuwputreksa; jsdfklupwurtklsdjgf;sdkflg jmnsdjfgsdfjg usdpsdfgsdg er stre" >> example; (( cntr++ )); done
- I used less, version 487, installed via brew.
Detailed steps to reproduce the problem:
- less -r example
What happened: Top screenful of lines of the file are not able to be displayed. They get sent to the scrollback buffer, but even the "1g" command, to move to line 1 in less, will not show those lines in less. Less, without -r, works properly.
What should have happened: Lines starting from 1 should be displayed in the first screenful. And they should be reachable from any location in the file via 1g command.
Incidential: I like -r, because it passes through the color output from grep and other commands. It is easiest to put that in an LESS environment variable. Example:
grep --color=always asdf example|less -r