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

Using batcat --pager "less -R" </path_to_file> doesen't convert ANSI characters in Kali #2965

Open
bonesiX opened this issue May 20, 2024 · 1 comment
Labels
question Further information is requested

Comments

@bonesiX
Copy link

bonesiX commented May 20, 2024

What steps will reproduce the bug?

I'm executing the command:

batcat --pager "less -R" </path_to_file>

The output looks like this:

image

I'm also tried to use "less -R" and the outputi is this:

image

How did you install bat?

sudo apt install bat

Operating system

Linux machine 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.15-2kali1 (2024-04-09) x86_64 GNU/Linux

batcat version

bat 0.24.0

Evironment variables

XDG_CURRENT_DESKTOP=GNOME
COLORTERM=truecolor
QT_IM_MODULE=ibus
QT_ACCESSIBILITY=1
SHELL=/usr/bin/zsh
XDG_SESSION_TYPE=x11
QT_QPA_PLATFORMTHEME=qt5ct
TERM=xterm-256color
PAGER=<not set>
LANG=en_CA.UTF-8
LC_ALL=en_CA.UTF-8
BAT_PAGER=<not set>
BAT_PAGING=<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=<not set>
NO_COLOR=<not set>
MANPAGER=<not set>

Less version

less 643 (GNU regular expressions)

@bonesiX bonesiX added the question Further information is requested label May 20, 2024
@keith-hall
Copy link
Collaborator

Just to check my understanding - when you run less -R path_to_file then it outputs colors?
That likely means that bat is given a file to syntax highlight which already contains ANSI escape codes. So naturally they get broken because bat is expecting plain text. Related: #2568 (comment)

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