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

How do you remove secondary line numbers column? #1586

Closed
pentago opened this issue Mar 15, 2021 · 6 comments
Closed

How do you remove secondary line numbers column? #1586

pentago opened this issue Mar 15, 2021 · 6 comments
Labels
question Further information is requested

Comments

@pentago
Copy link

pentago commented Mar 15, 2021

I'm aware that the line numbers column can be removed with --style=plain but how does one remove the other line numbers column?

screenshot: https://i.imgur.com/srD0Jys.png

@pentago pentago added the question Further information is requested label Mar 15, 2021
@Enselic
Copy link
Collaborator

Enselic commented Mar 15, 2021

Hi!

Can you reproduce this problem everywhere? I can not reproduce. Can you provide detailed step-by-step instructions on how to reproduce please?

It would also be helpful if you could paste the output of bat --diagnostic

@pentago
Copy link
Author

pentago commented Mar 16, 2021

I just run bat --style=plain

comparison between regular and plain style:
https://i.imgur.com/DMtqsBp.png

@Enselic
Copy link
Collaborator

Enselic commented Mar 16, 2021

I bet you get numbers also with plain cat? I suspect your shell is adding the numbers for any output.

In any case, I would be grateful if you could provide the output of bat --diagnostic.

@pentago
Copy link
Author

pentago commented Mar 16, 2021

No line numbers were added with regular cat.

Here's the diagnostic output:

Software version

bat 0.18.0

Operating system

Darwin 20.3.0

Command-line

bat --diagnostic 

Environment variables

SHELL=/usr/local/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 '/Users/dzhi/.config/bat/config': No such file or directory (os error 2).

Compile time information

  • Profile: release
  • Target triple: x86_64-apple-darwin
  • Family: unix
  • OS: macos
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2,sse3,ssse3
  • Host: x86_64-apple-darwin

Less version

> 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

@Enselic
Copy link
Collaborator

Enselic commented Mar 16, 2021

Interesting. Some follow up questions. Do you get the same line numbering problems if you

  1. use native macOS version of zsh, i.e. SHELL=/bin/zsh
  2. show the file with pure less?
  3. try to reproduce with a newly created user on that machine?

@pentago
Copy link
Author

pentago commented Mar 17, 2021

Godamn. I had the following env var configured in .zshrc: export LESS='-sMEFRNXI' where N shows line numbers.
Once I removed it from the rest of the flags, bat started working nicely.

THanks for pointing me in right direction! Didn't know bat depends on less for displaying.

@pentago pentago closed this as completed Mar 17, 2021
Enselic added a commit to Enselic/bat that referenced this issue Mar 17, 2021
So issues like sharkdp#1586 are easier to troubleshoot.
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

2 participants