bat: Can't view some files

I’m using bat on MacOS, installed using Homebrew (0.12.1). I’m on Catalina.

Some files (pycodestyle, isort.cfg) that I try to open simply don’t show. Terminal exits with a success code.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

I was under the impression that less was installed from homebrew for me, but clearly not. Installing it from homebrew fixed it.

Thanks, @eth-p!

That explains it! Your version of less is affected by the --quit-if-one-screen bug where it immediately enters and exits the terminal’s alternate screen mode. Bat is actually doing something, but because less does that, you never get to see the output.

If you try viewing other files smaller than your terminal, you’ll run into this exact same issue.

You have a couple options for fixing it, too. You can either remove that line from your config, or you can run brew install less to update to a newer version that patches it. I would recommend the latter, since it would also fix mouse wheel scrolling.