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

TSV highlighting doesn't work #2078

Open
ZJaume opened this issue Feb 17, 2022 · 3 comments
Open

TSV highlighting doesn't work #2078

ZJaume opened this issue Feb 17, 2022 · 3 comments
Labels
bug Something isn't working syntax-highlighting

Comments

@ZJaume
Copy link

ZJaume commented Feb 17, 2022

Describe the bug you encountered:
I'm reading tab-separated files with two columns at it seems that it is still using the comma as delimiter.

cat file | bat -l tsv gives:

imatge

What did you expect to happen instead?
Highlight each column in a different color.

How did you install bat?

cargo install --locked bat

Cargo version: 1.53.0
OS: Ubuntu 20.04
bat version: 0.19


bat version and environment

@ZJaume ZJaume added the bug Something isn't working label Feb 17, 2022
@keith-hall
Copy link
Collaborator

Thanks for reporting. We recently discussed one possible solution at #1977 (comment)

@ZJaume
Copy link
Author

ZJaume commented Nov 6, 2023

Would it be possiblo to merge this forkeith@c1a4e98? It seems to fix the issue for me. I've applied the commit patch to master and, after running ./assets/create.sh, cargo test shows all tests passing. I also ran some examples in CLI and highlighting looks good:

echo -e "yes\tMy word, separated" | ./target/debug/bat -l tsv

image
compared to master:

echo -e "yes\tMy word, separated" | bat -l tsv

image

Also piped csv seems to work automatically detecting separator:
image

@keith-hall
Copy link
Collaborator

feel free to create a PR for it. Ideally it needs some test files added to https://github.com/sharkdp/bat/tree/master/tests/syntax-tests/source/CSV to prove it highlights the various separated files correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working syntax-highlighting
Projects
None yet
Development

No branches or pull requests

2 participants