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

No output after resizing terminal window #1128

Closed
tom-henderson opened this issue Aug 4, 2020 · 7 comments
Closed

No output after resizing terminal window #1128

tom-henderson opened this issue Aug 4, 2020 · 7 comments
Labels
question Further information is requested

Comments

@tom-henderson
Copy link

What version of bat are you using?
bat 0.15.4

Describe the bug you encountered:
For some files, bat produces no output if the terminal window has been resized. For example bat README.md on this file https://github.com/tom-henderson/bookmarks/blob/master/README.md produces no output if the terminal has been resized. I assume this is related to the pager since bat --paging=never README.md still works.

Describe what you expected to happen?
Bat would always produce output.

How did you install bat?
homebrew


system

$ uname -srm
Darwin 19.4.0 x86_64

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.4
BuildVersion: 19E287

bat

$ bat --version
bat 0.15.4

$ env
BAT_THEME=Tomorrow-Night-Bright
BAT_PAGER=less -RF

$ bat --list-languages
Found custom syntax set.

$ bat --list-themes
Found custom theme set.

bat_config

bat_wrapper

No wrapper script for 'bat'.

bat_wrapper_function

No wrapper function for 'bat'.

No wrapper function for 'cat'.

tool

$ less --version
less 487 (POSIX regular expressions)

@tom-henderson tom-henderson added the bug Something isn't working label Aug 4, 2020
@sharkdp
Copy link
Owner

sharkdp commented Aug 15, 2020

Please see #1053 and the issues linked under "Handling of terminal resize events". I am assuming this is a duplicate of those?

@sharkdp sharkdp added duplicate This issue or pull request already exists and removed bug Something isn't working labels Aug 15, 2020
@tom-henderson
Copy link
Author

@sharkdp This might not be the same issue. I'm not resizing a window while bat is displaying a file. If I open a new window, resize it, and then use bat, some files will show no output.

@sharkdp
Copy link
Owner

sharkdp commented Aug 17, 2020

This might not be the same issue. I'm not resizing a window while bat is displaying a file.

Oh, you are right. Sorry for marking this as a duplicate too quickly.

Could you please try to unset BAT_PAGER? bat should select less automatically. Your less version is quite old. If you unset BAT_PAGER, bat will provide all necessary command-line options for your version of less.

Even better would be to upgrade to a recent version of less.

I'm not sure if that would fix your problem, but it's worth a try. You could also try to display the file with less -RF after resizing the terminal.

@sharkdp sharkdp added question Further information is requested and removed duplicate This issue or pull request already exists labels Aug 17, 2020
@tigger04
Copy link

I have exactly the same issue. Curiously less -RF appears to have the same issue, so I guess it's not exactly a bat defect

image

image

@tigger04
Copy link

unsetting BAT_PAGER does seem to resolve it

image

@tom-henderson
Copy link
Author

Ah yes so it looks like this issue is probably with less -RF and not with bat. Unsetting BAT_PAGER fixes this issue for me.

I think I had originally set BAT_PAGER in order to get the scroll wheel working in iTerm2.

@sharkdp
Copy link
Owner

sharkdp commented Aug 18, 2020

Glad this could be resolved - thank you for the feedback!

The problem is that you have to pass -X for older versions of less, if you are also passing -F. If BAT_PAGER it not set, bat does this automatically. If BAT_PAGER is set, bat assumes that the user knows better and simply executes whatever has been set.

@sharkdp sharkdp closed this as completed Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants