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

Short options -P and -pp do not take precedence over --paging=always set in ~/.config/bat/config #2128

Closed
lucatrv opened this issue Mar 21, 2022 · 6 comments · Fixed by #2660
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@lucatrv
Copy link

lucatrv commented Mar 21, 2022

Describe the bug you encountered:

I set --paging=always in my ~/.config/bat/config file. Then I can turn paging off by issuing the long option bat --paging=never. However neither bat -P or bat -pp work.

Note: this issue may affect also other short options, but I have tried only these ones.

What did you expect to happen instead?

Both bat -P and bat -pp should disable paging.

How did you install bat?

sudo pacman -S bat


bat version and environment

Software version

bat 0.20.0 (0655ecf)

Operating system

Linux 5.16.15-arch1-1

Command-line

bat -P /home/luca/.config/bat/config --diagnostic

Environment variables

SHELL=/bin/bash
PAGER=<not set>
LESS=<not set>
LANG=en_US.utf8
LC_ALL=<not set>
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='sh -c '\''col -bx | bat -l man -p'\'''

Config file

# This is `bat`s configuration file. Each line either contains a comment or
# a command-line option that you want to pass to `bat` by default. You can
# run `bat --help` to get a list of all possible configuration options.

# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
# for a list of all available themes
--theme="OneHalfDark"

# Enable this to use italic text on the terminal. This is not supported on all
# terminal emulators (like tmux, by default):
--italic-text=always

# Uncomment the following line to disable automatic paging:
--paging=always

# Uncomment the following line if you are using less version >= 551 and want to
# enable mouse scrolling support in `bat` when running inside tmux. This might
# disable text selection, unless you press shift.
#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"

# Syntax mappings: map a certain filename pattern to a language.
#   Example 1: use the C++ syntax for Arduino .ino files
#   Example 2: Use ".gitignore"-style highlighting for ".ignore" files
#--map-syntax "*.ino:C++"
#--map-syntax ".ignore:Git Ignore"

Compile time information

  • Profile: release
  • Target triple: x86_64-unknown-linux-gnu
  • Family: unix
  • OS: linux
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2
  • Host: x86_64-unknown-linux-gnu

Less version

> less --version
less 590 (PCRE2 regular expressions)
Copyright (C) 1984-2021  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.
Home page: https://greenwoodsoftware.com/less
@lucatrv lucatrv added the bug Something isn't working label Mar 21, 2022
@sharkdp sharkdp added the good first issue Good for newcomers label May 22, 2022
@sharkdp
Copy link
Owner

sharkdp commented May 22, 2022

Thank you for reporting this. I agree that this should be fixed. Can also be reproduced on the command-line. This opens a pager, but shouldn't:

bat --paging=always -P README.md

@kphevaxnkaw

This comment was marked as spam.

@dufferzafar
Copy link

PR #2201 was closed, but it does seem to solve this particular issue.

@themkat
Copy link
Contributor

themkat commented Aug 18, 2022

The PR #2201 was later merged after being re-opened. It fixes the issue with the -P option, but not the double pp. Just for information for future readers 🙂

@vishal1132
Copy link

Hi, can I work on double pp overriding the paging, and paging overriding the double pp? ./target/debug/bat --paging=always -pp Cargo.lock = paging is off, ./target/debug/bat -pp --paging=always Cargo.lock = paging is on.

@vishal1132
Copy link

Hi, I am linking a PR to address this issue #2330. If this doesn't solve or anything else is required, can someone please let me know? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants