-
Notifications
You must be signed in to change notification settings - Fork 89
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
[FEATURE] Option to retain 'LESS_TERMCAP_xx' colors in non-interactive terminals #593
Comments
Perhaps I'm not fully understanding, but if you're not using less for paging but only for adding coloring, I'm not sure that it's the right tool for the job. It seems like you could do what you want with a simple sed script or something like that. |
The request is to introduce an optional flag that retains the colors when the For similar use cases,
That is the question: do you think
For the use case outlined in the description of the issue, one can also use |
Can you explain why it would look better using less rather than bat? |
Problem
When a user defines
LESS_TERMCAP_xx
, these colors are not applied when theoutput of less is going to a non-interactive terminal.
Consider this Docker command as an example:
In an interactive terminal,
FOO
is displayed in bold blue. However, if you runthe same Docker command without the
--tty
flag,FOO
is not colored or bold.Feature Request
Would it be possible to add a new option that forces
LESS_TERMCAP_xx
colors tobe retained when the output of
less
goes to a non-interactive terminal?More context
My use case involves
fzf
and its--preview
window, which executes thecommand in non-interactive mode1.
The command downloads a html file using
curl
, and thehtml2text
transformsinto
text
but retains backspaces. Finally,less
would make the output morereadable by adding the user-defined
LESS_TERMCAP_xx
colors.Currently, the result looks like this:
But I would like it to look like this inside
fzf's
preview window:Footnotes
less
functionality is reduced in preview window · Issue #1118 · junegunn/fzf ↩The text was updated successfully, but these errors were encountered: