Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🐛less with --clear-screen doesn't work #185

Closed
kutsan opened this issue May 9, 2020 · 2 comments
Closed

🐛less with --clear-screen doesn't work #185

kutsan opened this issue May 9, 2020 · 2 comments

Comments

@kutsan
Copy link

kutsan commented May 9, 2020

Although other less options seems to be working fine. less doesn't trigger repaint with --clear-screen after pager is closed.

export PAGER='less --clear-screen'

Great software by the way.

@dandavison
Copy link
Owner

dandavison commented May 9, 2020

Hi @kutsan, thanks for this. Correct me if I'm wrong, but is it possible that you meant --no-init aka -X, rather than --clear-screen? I don't really understand the significance of what --clear-screen does, but it seems that --no-init is the less option that controls whether or not the screen is cleared when less exits.

In any case, here are the facts:

  1. If you set BAT_PAGER=less -R it will clear the screen when the pager exits. PAGER was being overridden deliberately, but BAT_PAGER was not.
  2. However, I've just merged Import less --no-init avoidance from bat #181, so this overriding behavior has gone away on master, and so it will clear the screen by default on master (not released to package managers yet).
  3. One does need to be a bit careful because there are several relevant settings. In particular, watch out for the LESS env var, as well as BAT_PAGER and PAGER: Maybe look at
    env | grep -iE '(less|bat|pager)'
    
  4. All this behavior in delta is the same as in bat because delta uses bat's paging code (Import less --no-init avoidance from bat #181 brings delta up-to-date with bat in this respect.)

@kutsan
Copy link
Author

kutsan commented May 9, 2020

Yes, you are right -X is probably the reason and I understand the difference. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants