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 · 2 comments · May be fixed by #2289
Open

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

bmjsmith opened this issue Oct 19, 2024 · 2 comments · May be fixed by #2289
Assignees

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

@seefood
Copy link
Contributor

seefood commented Jan 28, 2025

Looks about right. Would you like to make a pull request?

@seefood seefood self-assigned this Jan 28, 2025
seefood added a commit that referenced this issue Feb 11, 2025
this should fix #2261 without breaking any existing value of $LESS
@seefood seefood linked a pull request Feb 11, 2025 that will close this issue
8 tasks
@seefood
Copy link
Contributor

seefood commented Feb 11, 2025

Frankly I was not even sure the use of ${LESS:-} made any sense. please see PR #2289 and let me know if it's works for you.

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

Successfully merging a pull request may close this issue.

2 participants