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

[Bug]: man plugin can break less if you already have LESS set in your env #2261

Open
bmjsmith opened this issue Oct 19, 2024 · 0 comments
Open

Comments

@bmjsmith
Copy link

bmjsmith commented Oct 19, 2024

Expected behavior

bash-it plugin enable man should enable colouring for man pages.

Current behavior

bash-it plugin enable man causes less and every command that uses it e.g. git log, man, bat to break with the cryptic error No tags file.

Possible solution

I have export LESS=--quit-on-intr --RAW-CONTROL-CHARS in my .bashrc.

When the man plugin is enabled I get:
LESS=R-quit-on-intr --RAW-CONTROL-CHARS in my env.

I think this causes less to interpret this as -q -u -i -t etc. and the -t is enabling ctags support. There is no ctags file on my (default ubuntu) install. This causes every use of less to exit with the "No tags file" error. There's very little info around on what that means, this was hard to nail down.

This looks like a typo.

I think it should be export LESS="-R ${LESS:-}" or export LESS="--RAW-CONTROL-CHARS ${LESS:-}" or similar.

Context

Completely broke any command line tool using PAGER.

Steps to reproduce

bash-it plugin disable man
less somefile # works
export LESS="--quit-on-intr --RAW-CONTROL-CHARS"
bash-it plugin enable man
less somefile # probably doesn't work

Bash-it version

d985e4c

List of enabled plugins, themes and aliases

man

Bash version

5.2.21

Operating system and version

Ubuntu 24.04.01

bash-it doctor output

# How to get: bash-it doctor

Your ~/.bashrc

export LESS="--quit-on-intr --RAW-CONTROL-CHARS"

Notes

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant