I'm using bat on Windows 10, installed via scoop. After updating yesterday to the latest release, I'm seeing a change in behavior. When I bat a small file (that does not require paging), it looks like the terminal is cleared, the output is shown, and then things reset and I've lost the output.
With a longer file I get the normal paging behavior and things seem fine.
Things were working as expected prior to this latest release.
See screenshot: cat displays as expected; bat flashes the content then it is gone:

Thank you for reporting this. That looks like yet another problem with less.
Could you please tell us which version of less you are running?
less --version
As a workaround, you can disable paging by adding
--paging=never
to your bat config file.
The behavior that is new since the last release is the following: #786
partly related: #860
@glucas Any update on this? I'd really like to fix this if this is a bug.
I've looked into this myself. I can reproduce this on Windows with less 551.
The problem is the following:
We used to call less with
less --RAW-CONTROL-CHARS --quit-if-one-screen --no-init
We only passed --no-init because there was a bug with previous versions of less which required the use of --no-init in combination with --quit-if-one-screen to prevent this "no output" issue from happening.
Since bat 0.13, we omit the --no-init option if we can detect that the version of less is higher than or equal to 530. We did that because --no-init breaks mouse support and because less 530 fixed the above-mentioned bug. However, it seems that this bug was not fixed on Windows!
If I call
less --RAW-CONTROL-CHARS --quit-if-one-screen small-file
on a small file, I don't see any output (only a small flash, as described above). On Linux, everything works fine.
Maybe @gwsw could have a look? (only if you find the time!)
Hi @sharkdp, I am running bat 0.13.0 on MacOS Catalina and I am having similar issues as to what is reported here. Small files not needing the pager will not show up (although the screen flickers like it's going to show the contents, but just returns back out to a prompt.
If I use the --pager=none option small files not needing the pager will show as expected.
$ bat --version
bat 0.13.0
$ less --version
less 487 (POSIX regular expressions)
Copyright (C) 1984-2016 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.
Homepage: http://www.greenwoodsoftware.com/less
If this should be a new issue let me know but since they seemed similar enough I thought I would start here.
If this should be a new issue let me know but since they seemed similar enough I thought I would start here.
@dugdun Thank you for reporting this. It would be great if you could open a new bug report using the corresponding issue template: https://github.com/sharkdp/bat/issues/new?assignees=&labels=bug&template=bug_report.md&title=
It would be great if you could open a new bug report
@sharkdp I've filed a new bug report. Sorry for cluttering this issue.
Thanks for the awesome tool!
Could you try less v558 at https://github.com/gwsw/less and verify whether that fixes the problem for you?
@gwsw Thank you very much for this update!
I tried building v558 from source in my VirtualBox Windows setup, but gave up after an hour or so. I'm not really familiar with the Windows Visual C++ world. If anyone could build a amd64 binary for me, I'm happy to try this out.
If this fixes the bug on Windows, we can change bats behavior to only omit --no-init if less_version >= 558. Something like:
Some(version) if (version < 530 || (cfg!(windows) && version < 558)) => {
p.arg("--no-init");
}
I found a problem with less v558 and have updated it. Please used v559 for your testing.
@gwsw Thank you very much for your support. I'm going to assume that the bug is fixed in 559, so I updated the logic accordingly: 864656bd11d4f96235408e026f7ac68d86995919
If someone is able to test this, any support would be greatly appreciated. In the meantime, I'm going to close this ticket. The issue will definitely be solved for less 551.
This has been fixed in bat v0.14.