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

Inputfile wrapper #336

Merged
merged 12 commits into from
Oct 7, 2018
Merged

Inputfile wrapper #336

merged 12 commits into from
Oct 7, 2018

Conversation

sharkdp
Copy link
Owner

@sharkdp sharkdp commented Oct 7, 2018

  • Add first-line detection for all input types, including pipes.

    So this just works:

    curl https://sh.rustup.rs | bat

    This closes Automatic syntax detection/guessing without using filename #205

  • Do not display binary files in interactive mode.

    When attempting to display binary files, we just show this:

    ▶ bat test.jpg 
    ───────┬─────────────────────────────────────────────────
           │ File: test.jpg   <BINARY>
    ───────┴─────────────────────────────────────────────────
    

    This closes Handling of binary files in interactive mode #248

@sharkdp sharkdp merged commit e97095b into master Oct 7, 2018
@sharkdp sharkdp deleted the inputfile-wrapper branch October 7, 2018 13:34
@zeenix
Copy link

zeenix commented May 1, 2019

Has this regressed in the last (0.10) release? I don't get syntax hilighting for XML output of virsh dumpxml 7njz4pq0m0|bat. The first line is <domain type='kvm'>.

@sharkdp
Copy link
Owner Author

sharkdp commented May 8, 2019

This only works for a few selected first-line patterns (check out the respective Sublime Text syntax files for details). This works, for example:

echo '<?xml version="1.0">' | bat

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

Successfully merging this pull request may close these issues.

Handling of binary files in interactive mode Automatic syntax detection/guessing without using filename
2 participants