Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Paging broken #1639

Closed
makew0rld opened this issue May 9, 2021 · 5 comments
Closed

Paging broken #1639

makew0rld opened this issue May 9, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@makew0rld
Copy link

Describe the bug you encountered:

When using bat, it does not respond to mouse scrolling, and exiting bat does not clear the visible file buffer out of the terminal.

What did you expect to happen instead?

Bat is paging with less, and so I expect it to act exactly like less. When I use less, it responds to mouse scrolling, and the file is not visible after leaving less with q.

How did you install bat?

From the Arch Linux package repos. Specifically community/bat.


bat version and environment

Software version

bat 0.18.0

Operating system

Linux 5.11.16-arch1-1

Command-line

bat dither.go --diagnostic 

Environment variables

SHELL=/usr/bin/zsh
PAGER=less
BAT_PAGER=<not set>
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=<not set>
XDG_CACHE_HOME=<not set>
COLORTERM=truecolor
NO_COLOR=<not set>
MANPAGER=<not set>

Config file

Could not read contents of '/home/makeworld/.config/bat/config': No such file or directory (os error 2).

Compile time information

  • Profile: release
  • Target triple: x86_64-unknown-linux-gnu
  • Family: unix
  • OS: linux
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2
  • Host: x86_64-unknown-linux-gnu

Less version

> less --version 
less 581.2 (PCRE2 regular expressions)
Copyright (C) 1984-2021  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Home page: https://greenwoodsoftware.com/less
@makew0rld makew0rld added the bug Something isn't working label May 9, 2021
@makew0rld
Copy link
Author

Just want to add that bat did not always do this. I'm not sure what caused the change, but I remember this working fine in the past.

@eth-p
Copy link
Collaborator

eth-p commented May 9, 2021

This is caused by bat failing to parse the version of less (fix coming in #1629).

Basically, bat extracts the version string 581.2 and tries to parse it as an integer. It encounters the . and fails, which causes bat to assume only the oldest version of less is available.

When using an old version of less, bat passes along the --no-init option, which causes the issues you're describing.

@makew0rld
Copy link
Author

Sounds good, thanks! Hope a new version will come soon.

@sharkdp
Copy link
Owner

sharkdp commented May 12, 2021

closing this, as #1629 by @aswild has been merged.

@sharkdp sharkdp closed this as completed May 12, 2021
@sharkdp
Copy link
Owner

sharkdp commented May 13, 2021

Fixed in bat 0.18.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants