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

iTerm2 issue with fullscreen #294

Closed
scalp42 opened this issue Sep 8, 2018 · 3 comments
Closed

iTerm2 issue with fullscreen #294

scalp42 opened this issue Sep 8, 2018 · 3 comments
Labels
question Further information is requested

Comments

@scalp42
Copy link

scalp42 commented Sep 8, 2018

Thanks a lot for bat!

I just noticed that if you bat a file in iTerm2 and simply keep switching back and forth to fullscreen, the output gets messed up pretty bad.

Here is an example, bat a file belonging to Homebrew:

screen shot 2018-09-07 at 8 26 42 pm

screen shot 2018-09-07 at 8 26 45 pm

Now if I simply get out of fullscreen, output gets messed up:

screen shot 2018-09-07 at 8 27 51 pm

screen shot 2018-09-07 at 8 28 39 pm

You can also see the scrollbar in the terminal growing, simply switching back and forth to fullscreen (cmd+enter):

screen shot 2018-09-07 at 8 29 42 pm

Not even sure where to start with this, but let me know if I can help!

@eth-p
Copy link
Collaborator

eth-p commented Sep 8, 2018

You can also see the scrollbar in the terminal growing

This would be because of less, the default pager for bat. less will automatically resize itself with the terminal and re-print everything to fit the new size. The content that was on the screen before the re-print is pushed back into the scrollback buffer, which creates a jumbled mess when scrolling back up.

If you disable the pager with --paging=never, this shouldn't happen anymore. A more permanent fix would be to add export BAT_PAGER=cat export BAT_PAGER='' (thanks for the tip, @sharkdp!) to your .bash_profile file, though.


As for the last image: the line wrapping fails because the terminal was resized to a smaller width than when it was printed, which makes iTerm's text wrapping take over. Unfortunately, once bat passes control to the pager, there's no way redraw/refresh the output to fit the smaller terminal.

@sharkdp
Copy link
Owner

sharkdp commented Sep 8, 2018

Thank you for helping out here, @eth-p. Just a minor comment: To disable the pager permanently, you can use export BAT_PAGER="" (instead of setting it to cat). This way, bat will not spawn an additional process.

@sharkdp sharkdp added the question Further information is requested label Sep 9, 2018
@scalp42
Copy link
Author

scalp42 commented Sep 10, 2018

export BAT_PAGER="" working great!

Thanks for the help, closing ❤️

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