A cat(1) clone with wings.

Overview

bat - a cat clone with wings
Build Status license Version info
A cat(1) clone with syntax highlighting and Git integration.

Key FeaturesHow To UseInstallationCustomizationProject goals, alternatives
[中文] [日本語] [한국어] [Русский]

Syntax highlighting

bat supports syntax highlighting for a large number of programming and markup languages:

Syntax highlighting example

Git integration

bat communicates with git to show modifications with respect to the index (see left side bar):

Git integration example

Show non-printable characters

You can use the -A/--show-all option to show and highlight non-printable characters:

Non-printable character example

Automatic paging

By default, bat pipes its own output to a pager (e.g less) if the output is too large for one screen. If you would rather bat work like cat all the time (never page output), you can set --paging=never as an option, either on the command line or in your configuration file. If you intend to alias cat to bat in your shell configuration, you can use alias cat='bat --paging=never' to preserve the default behavior.

File concatenation

Even with a pager set, you can still use bat to concatenate files 😉 . Whenever bat detects a non-interactive terminal (i.e. when you pipe into another process or into a file), bat will act as a drop-in replacement for cat and fall back to printing the plain file contents, regardless of the --pager option's value.

How to use

Display a single file on the terminal

> bat README.md

Display multiple files at once

> bat src/*.rs

Read from stdin, determine the syntax automatically (note, highlighting will only work if the syntax can be determined from the first line of the file, usually through a shebang such as #!/bin/sh)

> curl -s https://sh.rustup.rs | bat

Read from stdin, specify the language explicitly

> yaml2json .travis.yml | json_pp | bat -l json

Show and highlight non-printable characters:

> bat -A /etc/hosts

Use it as a cat replacement:

bat > note.md  # quickly create a new file

bat header.md content.md footer.md > document.md

bat -n main.rs  # show line numbers (only)

bat f - g  # output 'f', then stdin, then 'g'.

Integration with other tools

find or fd

You can use the -exec option of find to preview all search results with bat:

find … -exec bat {} +

If you happen to use fd, you can use the -X/--exec-batch option to do the same:

fd … -X bat

ripgrep

With batgrep, bat can be used as the printer for ripgrep search results.

batgrep needle src/

tail -f

bat can be combined with tail -f to continuously monitor a given file with syntax highlighting.

tail -f /var/log/pacman.log | bat --paging=never -l log

Note that we have to switch off paging in order for this to work. We have also specified the syntax explicitly (-l log), as it can not be auto-detected in this case.

git

You can combine bat with git show to view an older version of a given file with proper syntax highlighting:

git show v0.6.0:src/main.rs | bat -l rs

git diff

You can combine bat with git diff to view lines around code changes with proper syntax highlighting:

batdiff() {
    git diff --name-only --diff-filter=d | xargs bat --diff
}

If you prefer to use this as a separate tool, check out batdiff in bat-extras.

If you are looking for more support for git and diff operations, check out delta.

xclip

The line numbers and Git modification markers in the output of bat can make it hard to copy the contents of a file. To prevent this, you can call bat with the -p/--plain option or simply pipe the output into xclip:

bat main.cpp | xclip

bat will detect that the output is being redirected and print the plain file contents.

man

bat can be used as a colorizing pager for man, by setting the MANPAGER environment variable:

export MANPAGER="sh -c 'col -bx | bat -l man -p'"
man 2 select

(replace bat by batcat if you are on Debian or Ubuntu)

It might also be necessary to set MANROFFOPT="-c" if you experience formatting problems.

If you prefer to have this bundled in a new command, you can also use batman.

Note that the Manpage syntax is developed in this repository and still needs some work.

Also, note that this will not work with Mandocs man implementation.

prettier / shfmt / rustfmt

The prettybat script is a wrapper that will format code and print it with bat.

Installation

Packaging status

On Ubuntu (using apt)

... and other Debian-based Linux distributions.

bat is making its way through the Ubuntu and Debian package release process, and is available for Ubuntu as of Eoan 19.10. On Debian bat is currently only available on the unstable "Sid" branch.

If your Ubuntu/Debian installation is new enough you can simply run:

apt install bat

Important: If you install bat this way, please note that the executable may be installed as batcat instead of bat (due to a name clash with another package). You can set up a bat -> batcat symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:

mkdir -p ~/.local/bin
ln -s /usr/bin/batcat ~/.local/bin/bat

On Ubuntu (using most recent .deb packages)

... and other Debian-based Linux distributions.

If the package has not yet been promoted to your Ubuntu/Debian installation, or you want the most recent release of bat, download the latest .deb package from the release page and install it via:

sudo dpkg -i bat_0.17.1_amd64.deb  # adapt version number and architecture

On Alpine Linux

You can install the bat package from the official sources, provided you have the appropriate repository enabled:

apk add bat

On Arch Linux

You can install the bat package from the official sources:

pacman -S bat

On Fedora

You can install the bat package from the official Fedora Modular repository.

dnf install bat

On Gentoo Linux

You can install the bat package from the official sources:

emerge sys-apps/bat

On Void Linux

You can install bat via xbps-install:

xbps-install -S bat

On Termux

You can install bat via pkg:

pkg install bat

On FreeBSD

You can install a precompiled bat package with pkg:

pkg install bat

or build it on your own from the FreeBSD ports:

cd /usr/ports/textproc/bat
make install

Via nix

You can install bat using the nix package manager:

nix-env -i bat

On openSUSE

You can install bat with zypper:

zypper install bat

Via snap package

There is currently no recommended snap package available. Existing packages may be available, but are not officially supported and may contain issues.

On macOS (or Linux) via Homebrew

You can install bat with Homebrew on MacOS or Homebrew on Linux:

brew install bat

On macOS via MacPorts

Or install bat with MacPorts:

port install bat

On Windows

There are a few options to install bat on Windows. Once you have installed bat, take a look at the "Using bat on Windows" section.

Prerequisites

You will need to install the Visual C++ Redistributable package.

With Chocolatey

You can install bat via Chocolatey:

choco install bat

With Scoop

You can install bat via scoop:

scoop install bat

From prebuilt binaries:

You can download prebuilt binaries from the Release page,

You will need to install the Visual C++ Redistributable package.

From binaries

Check out the Release page for prebuilt versions of bat for many different architectures. Statically-linked binaries are also available: look for archives with musl in the file name.

From source

If you want to build bat from source, you need Rust 1.42 or higher. You can then use cargo to build everything:

cargo install --locked bat

Note that additional files like the man page or shell completion files can not be installed in this way. They will be generated by cargo and should be available in the cargo target folder (under build).

Customization

Highlighting theme

Use bat --list-themes to get a list of all available themes for syntax highlighting. To select the TwoDark theme, call bat with the --theme=TwoDark option or set the BAT_THEME environment variable to TwoDark. Use export BAT_THEME="TwoDark" in your shell's startup file to make the change permanent. Alternatively, use bats configuration file.

If you want to preview the different themes on a custom file, you can use the following command (you need fzf for this):

bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"

bat looks good on a dark background by default. However, if your terminal uses a light background, some themes like GitHub or OneHalfLight will work better for you. You can also use a custom theme by following the 'Adding new themes' section below.

8-bit themes

bat has three themes that always use 8-bit colors, even when truecolor support is available:

  • ansi looks decent on any terminal. It uses 3-bit colors: black, red, green, yellow, blue, magenta, cyan, and white.
  • base16 is designed for base16 terminal themes. It uses 4-bit colors (3-bit colors plus bright variants) in accordance with the base16 styling guidelines.
  • base16-256 is designed for base16-shell. It replaces certain bright colors with 8-bit colors from 16 to 21. Do not use this simply because you have a 256-color terminal but are not using base16-shell.

Although these themes are more restricted, they have two advantages over truecolor themes:

  • They harmonize better with other terminal software using 3-bit or 4-bit colors.
  • When you change your terminal theme, bat output already on the screen will update to match.

Output style

You can use the --style option to control the appearance of bats output. You can use --style=numbers,changes, for example, to show only Git changes and line numbers but no grid and no file header. Set the BAT_STYLE environment variable to make these changes permanent or use bats configuration file.

Adding new syntaxes / language definitions

Should you find that a particular syntax is not available within bat, you can follow these instructions to easily add new syntaxes to your current bat installation.

bat uses the excellent syntect library for syntax highlighting. syntect can read any Sublime Text .sublime-syntax file and theme.

A good resource for finding Sublime Syntax packages is Package Control. Once you found a syntax:

  1. Create a folder with syntax definition files:

    mkdir -p "$(bat --config-dir)/syntaxes"
    cd "$(bat --config-dir)/syntaxes"
    
    # Put new '.sublime-syntax' language definition files
    # in this folder (or its subdirectories), for example:
    git clone https://github.com/tellnobody1/sublime-purescript-syntax
  2. Now use the following command to parse these files into a binary cache:

    bat cache --build
  3. Finally, use bat --list-languages to check if the new languages are available.

    If you ever want to go back to the default settings, call:

    bat cache --clear
  4. If you think that a specific syntax should be included in bat by default, please consider opening a "syntax request" ticket after reading the policies and instructions here: Open Syntax Request.

Adding new themes

This works very similar to how we add new syntax definitions.

First, create a folder with the new syntax highlighting themes:

mkdir -p "$(bat --config-dir)/themes"
cd "$(bat --config-dir)/themes"

# Download a theme in '.tmTheme' format, for example:
git clone https://github.com/greggb/sublime-snazzy

# Update the binary cache
bat cache --build

Finally, use bat --list-themes to check if the new themes are available.

Adding or changing file type associations

You can add new (or change existing) file name patterns using the --map-syntax command line option. The option takes an argument of the form pattern:syntax where pattern is a glob pattern that is matched against the file name and the absolute file path. The syntax part is the full name of a supported language (use bat --list-languages for an overview).

Note: You probably want to use this option as an entry in bats configuration file instead of passing it on the command line (see below).

Example: To use "INI" syntax highlighting for all files with a .conf file extension, use

--map-syntax='*.conf:INI'

Example: To open all files called .ignore (exact match) with the "Git Ignore" syntax, use:

--map-syntax='.ignore:Git Ignore'

Example: To open all .conf files in subfolders of /etc/apache2 with the "Apache Conf" syntax, use (this mapping is already built in):

--map-syntax='/etc/apache2/**/*.conf:Apache Conf'

Using a different pager

bat uses the pager that is specified in the PAGER environment variable. If this variable is not set, less is used by default. If you want to use a different pager, you can either modify the PAGER variable or set the BAT_PAGER environment variable to override what is specified in PAGER.

If you want to pass command-line arguments to the pager, you can also set them via the PAGER/BAT_PAGER variables:

export BAT_PAGER="less -RF"

Instead of using environment variables, you can also use bats configuration file to configure the pager (--pager option).

Note: By default, if the pager is set to less (and no command-line options are specified), bat will pass the following command line options to the pager: -R/--RAW-CONTROL-CHARS, -F/--quit-if-one-screen and -X/--no-init. The last option (-X) is only used for less versions older than 530.

The -R option is needed to interpret ANSI colors correctly. The second option (-F) instructs less to exit immediately if the output size is smaller than the vertical size of the terminal. This is convenient for small files because you do not have to press q to quit the pager. The third option (-X) is needed to fix a bug with the --quit-if-one-screen feature in old versions of less. Unfortunately, it also breaks mouse-wheel support in less.

If you want to enable mouse-wheel scrolling on older versions of less, you can pass just -R (as in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer, it should work out of the box.

Indentation

bat expands tabs to 4 spaces by itself, not relying on the pager. To change this, simply add the --tabs argument with the number of spaces you want to be displayed.

Note: Defining tab stops for the pager (via the --pager argument by bat, or via the LESS environment variable for less) won't be taken into account because the pager will already get expanded spaces instead of tabs. This behaviour is added to avoid indentation issues caused by the sidebar. Calling bat with --tabs=0 will override it and let tabs be consumed by the pager.

Dark mode

If you make use of the dark mode feature in macOS, you might want to configure bat to use a different theme based on the OS theme. The following snippet uses the default theme when in the dark mode and the GitHub theme when in the light mode.

alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"

Configuration file

bat can also be customized with a configuration file. The location of the file is dependent on your operating system. To get the default path for your system, call

bat --config-file

Alternatively, you can use the BAT_CONFIG_PATH environment variable to point bat to a non-default location of the configuration file:

export BAT_CONFIG_PATH="/path/to/bat.conf"

A default configuration file can be created with the --generate-config-file option.

bat --generate-config-file

Format

The configuration file is a simple list of command line arguments. Use bat --help to see a full list of possible options and values. In addition, you can add comments by prepending a line with the # character.

Example configuration file:

# Set the theme to "TwoDark"
--theme="TwoDark"

# Show line numbers, Git modifications and file header (but no grid)
--style="numbers,changes,header"

# Use italic text on the terminal (not supported on all terminals)
--italic-text=always

# Use C++ syntax for .ino files
--map-syntax "*.ino:C++"

Using bat on Windows

bat mostly works out-of-the-box on Windows, but a few features may need extra configuration.

Prerequisites

You will need to install the Visual C++ Redistributable package.

Paging

Windows only includes a very limited pager in the form of more. You can download a Windows binary for less from its homepage or through Chocolatey. To use it, place the binary in a directory in your PATH or define an environment variable. The Chocolatey package installs less automatically.

Colors

Windows 10 natively supports colors in both conhost.exe (Command Prompt) and PowerShell since v1511, as well as in newer versions of bash. On earlier versions of Windows, you can use Cmder, which includes ConEmu.

Note: The Git and MSYS versions of less do not correctly interpret colors on Windows. If you don’t have any other pagers installed, you can disable paging entirely by passing --paging=never or by setting BAT_PAGER to an empty string.

Cygwin

bat on Windows does not natively support Cygwin's unix-style paths (/cygdrive/*). When passed an absolute cygwin path as an argument, bat will encounter the following error: The system cannot find the path specified. (os error 3)

This can be solved by creating a wrapper or adding the following function to your .bash_profile file:

bat() {
    local index
    local args=("$@")
    for index in $(seq 0 ${#args[@]}) ; do
        case "${args[index]}" in
        -*) continue;;
        *)  [ -e "${args[index]}" ] && args[index]="$(cygpath --windows "${args[index]}")";;
        esac
    done
    command bat "${args[@]}"
}

Troubleshooting

Terminals & colors

bat handles terminals with and without truecolor support. However, the colors in most syntax highlighting themes are not optimized for 8-bit colors. It is therefore strongly recommended that you use a terminal with 24-bit truecolor support (terminator, konsole, iTerm2, ...), or use one of the basic 8-bit themes designed for a restricted set of colors. See this article for more details and a full list of terminals with truecolor support.

Make sure that your truecolor terminal sets the COLORTERM variable to either truecolor or 24bit. Otherwise, bat will not be able to determine whether or not 24-bit escape sequences are supported (and fall back to 8-bit colors).

Line numbers and grid are hardly visible

Please try a different theme (see bat --list-themes for a list). The OneHalfDark and OneHalfLight themes provide grid and line colors that are brighter.

File encodings

bat natively supports UTF-8 as well as UTF-16. For every other file encoding, you may need to convert to UTF-8 first because the encodings can typically not be auto-detected. You can iconv to do so. Example: if you have a PHP file in Latin-1 (ISO-8859-1) encoding, you can call:

iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat

Note: you might have to use the -l/--language option if the syntax can not be auto-detected by bat.

Development

# Recursive clone to retrieve all submodules
git clone --recursive https://github.com/sharkdp/bat

# Build (debug version)
cd bat
cargo build --bins

# Run unit tests and integration tests
cargo test

# Install (release version)
cargo install --path . --locked

# Build a bat binary with modified syntaxes and themes
bash assets/create.sh
cargo install --path . --locked --force

If you want to build an application that uses bats pretty-printing features as a library, check out the the API documentation. Note that you have to use either regex-onig or regex-fancy as a feature when you depend on bat as a library.

Contributing

Take a look at the CONTRIBUTING.md guide.

Maintainers

Project goals and alternatives

bat tries to achieve the following goals:

  • Provide beautiful, advanced syntax highlighting
  • Integrate with Git to show file modifications
  • Be a drop-in replacement for (POSIX) cat
  • Offer a user-friendly command-line interface

There are a lot of alternatives, if you are looking for similar programs. See this document for a comparison.

License

Copyright (c) 2018-2020 bat-developers.

bat is made available under the terms of either the MIT License or the Apache License 2.0, at your option.

See the LICENSE-APACHE and LICENSE-MIT files for license details.

Comments
  • Complete collection of syntax highlighting test files

    Complete collection of syntax highlighting test files

    With all the recent news about Hacktoberfest I thought it would be a good idea to point out good beginner issues that would be actually helpful for bat. In the past years, I have actually experienced Hacktoberfest as a really great event - both as a contributor as well as a maintainer.

    As of recently, bat has a set of syntax highlighting regression tests (see #1124 for more details). The main idea is that we have a large collection of test files for each and every language that bat can highlight. This way, we can make sure that we do not run into issues we had in the past where either (1) syntax highlighting for some language is suddenly not working anymore or (2) bat suddenly crashes/panics for some input (due to incompatibilities in the regex flavors in syntect and Sublime Text).

    In order to add a new test file, you can follow these steps (let's take "Ruby" as an example):

    1. Make sure that you are running the latest version of bat (master or bat 0.16) and that bat is available on the path.
    2. Find an example Ruby source file or write one yourself. If possible, the file should aim to be "comprehensive" (i.e. include a lot of the possible syntax), but this is not strictly necessary. A simple file is better than none at all. Also, the files shouldn't be gigantic.
    3. Save the file in tests/syntax-tests/source/Ruby (adapt for your language). The file name could be test.rb (adapt extension) but can also be adapted if that is necessary in order for bat to highlight it correctly (e.g. Makefile).
    4. If you have copied the file from somewhere else, please make sure that the file may be copied under the respective license and that the license is compatible with bats license. If it requires attribution, please add a LICENSE.md in the same folder with a text like this:
      The `test.rb` file has been added from [enter source here] under the following license: 
      
      [add license text here]
      
    5. Go to tests/syntax-tests and run the update.sh Bash script. A new file should be generated in the highlighted folder (e.g. highlighted/Ruby/test.rb).
    6. Use cat or bat --language=txt to display the content of this file and make sure that the syntax highlighting looks correct.
    7. git add the new files in the source folder as well as the autogenerated files in the highlighted folder.
    8. Commit and submit a PR! Please reference this issue (#1213).

    List of languages / syntaxes:

    • [x] ActionScript
    • [x] Apache Conf
    • [x] AppleScript
    • [x] ARM Assembly
    • [x] AsciiDoc (Asciidoctor)
    • [x] ASP
    • [x] Assembly (x86_64)
    • [x] AWK
    • [x] Batch File
    • [x] BibTeX
    • [x] Bourne Again Shell (bash)
    • [x] C
    • [x] C#
    • [x] C++
    • [x] Cabal
    • [x] Clojure
    • [x] CMake
    • [x] CoffeeScript
    • [x] CpuInfo (/proc/cpuinfo)
    • [x] Crystal
    • [x] CSS
    • [x] CSV
    • [x] D
    • [x] Dart
    • [x] Diff
    • [x] Dockerfile
    • [x] DotENV
    • [x] Elixir
    • [x] Elm
    • [x] Email
    • [x] Erlang
    • [x] F#
    • [x] Fortran
    • [x] Friendly Interactive Shell (fish)
    • [x] fstab
    • [x] Git Attributes
    • [x] Git Config
    • [x] Git Ignore
    • [x] GLSL
    • [x] Go
    • [x] GraphQL
    • [x] Graphviz (DOT)
    • [x] Groovy
    • [x] /etc/group
    • [x] Haskell
    • [x] Highlight non-printables (--show-all)
    • [x] /etc/hosts
    • [x] HTML
    • [x] INI
    • [x] Java
    • [x] Java Server Page (JSP)
    • [x] JavaScript
    • [x] Jinja2
    • [x] JSON
    • [x] jsonnet
    • [x] Julia
    • [x] Kotlin
    • [x] LaTeX
    • [x] Less
    • [x] Lisp
    • [x] Literate Haskell
    • [x] Lua
    • [x] Makefile
    • [x] Manpage
    • [x] Markdown
    • [x] MATLAB
    • [x] MemInfo (/proc/meminfo)
    • [x] NAnt Build File
    • [x] nginx
    • [x] Nim
    • [x] Nix
    • [x] Objective-C
    • [x] Objective-C++
    • [x] OCaml
    • [x] orgmode
    • [x] Pascal
    • [x] /etc/passwd
    • [x] Perl
    • [x] PHP
    • [x] Plain Text
    • [x] PowerShell
    • [x] Protocol Buffer
    • [x] Puppet
    • [x] PureScript
    • [x] Python
    • [x] QML
    • [x] R
    • [x] Rego
    • [x] Regular Expression
    • [x] requirements.txt
    • [x] resolv (/etc/resolv.conf)
    • [x] reStructuredText
    • [x] Robot Framework.
    • [x] Ruby
    • [x] Ruby Haml
    • [x] Ruby on Rails
    • [x] Rust
    • [x] Salt State (SLS)
    • [x] Sass
    • [x] Scala
    • [x] SCSS
    • [x] SML
    • [x] SQL
    • [x] SSH Config
    • [x] SSHD Config
    • [x] Strace
    • [x] Stylus
    • [x] Swift
    • [x] syslog
    • [x] Tcl
    • [x] Terraform
    • [x] TeX
    • [x] Textile
    • [x] TOML
    • [x] TypeScript
    • [x] TypeScriptReact
    • [x] varlink
    • [x] Verilog
    • [x] VimL
    • [x] Vue Component
    • [x] XML
    • [x] YAML

    It would be great if we could focus on the syntaxes in sublimehq/Packages first (marked in bold) as this would allow us to merge #1174 without having to worry (too much) about syntax highlighting regressions. Also, most of these are really popular languages, so it makes sense to have them in the test suite.

    good first issue syntax-highlighting 
    opened by sharkdp 48
  • Bottom border is cut off when pager is active on Windows

    Bottom border is cut off when pager is active on Windows

    What version of bat are you using? bat 0.15.4

    Describe the bug you encountered: It looks like the bottom border bat displays by default is cut off on Windows, when the pager is active, as shown in this screenshot:

    With pager

    image

    Without pager

    image

    I have bat also installed in WSL on Ubuntu 20.04 and this issue isn't present at all, which makes me think there's something wrong with how Windows handles less.

    Describe what you expected to happen? Bottom border not being cut off like on other platforms :)

    How did you install bat? scoop install bat

    EDIT: I'll add my less version for completeness

    less 561 (Spencer V8 regular expressions)
    Copyright (C) 1984-2020  Mark Nudelman
    

    Windows version; Windows 10 2004 (OS Build 19041.329)

    help wanted windows upstream-error 
    opened by brainplot 35
  • Terminal width seems to be unused, resulting in very small output

    Terminal width seems to be unused, resulting in very small output

    What version of bat are you using? bat 0.15.0

    Describe the bug you encountered:

    bat is no longer recognising the terminal width on iTerm2 3.3.9.

    It seems like it is using 44 as the width, while my terminal is wider than 200 characters.

    ───────┬────────────────────────────────────
           │ File: LICENSE
    ───────┼────────────────────────────────────
       1   │                   GNU LIBRARY GENER
           │ AL PUBLIC LICENSE
       2   │                        Version 2, J
           │ une 1991
       3   │
       4   │  Copyright (C) 1991 Free Software F
           │ oundation, Inc.
       5   │  51 Franklin Street, Fifth Floor, B
           │ oston, MA  02110-1301  USA
       6   │  Everyone is permitted to copy and
           │ distribute verbatim copies
       7   │  of this license document, but chan
           │ ging it is not allowed.
       8   │
       9   │ [This is the first released version
           │  of the library GPL.  It is
      10   │  numbered 2 because it goes with ve
           │ rsion 2 of the ordinary GPL.]
      11   │
      12   │                             Preambl
           │ e
      13   │
      14   │   The licenses for most software ar
           │ e designed to take away your
      15   │ freedom to share and change it.  By
           │  contrast, the GNU General Public
      16   │ Licenses are intended to guarantee
           │ your freedom to share and change
      17   │ free software--to make sure the sof
           │ tware is free for all its users.
      18   │
      19   │   This license, the Library General
           │  Public License, applies to some
      20   │ specially designated Free Software
           │ Foundation software, and to any
      21   │ other libraries whose authors decid
           │ e to use it.  You can use it for
      22   │ your libraries, too.
      23   │
      24   │   When we speak of free software, w
    

    Describe what you expected to happen?

    ───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
           │ File: LICENSE
    ───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       1   │                   GNU LIBRARY GENERAL PUBLIC LICENSE
       2   │                        Version 2, June 1991
       3   │
       4   │  Copyright (C) 1991 Free Software Foundation, Inc.
       5   │  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
       6   │  Everyone is permitted to copy and distribute verbatim copies
       7   │  of this license document, but changing it is not allowed.
       8   │
       9   │ [This is the first released version of the library GPL.  It is
      10   │  numbered 2 because it goes with version 2 of the ordinary GPL.]
      11   │
      12   │                             Preamble
      13   │
      14   │   The licenses for most software are designed to take away your
      15   │ freedom to share and change it.  By contrast, the GNU General Public
      16   │ Licenses are intended to guarantee your freedom to share and change
      17   │ free software--to make sure the software is free for all its users.
      18   │
      19   │   This license, the Library General Public License, applies to some
      20   │ specially designated Free Software Foundation software, and to any
      21   │ other libraries whose authors decide to use it.  You can use it for
      22   │ your libraries, too.
      23   │
      24   │   When we speak of free software, we are referring to freedom, not
      25   │ price.  Our General Public Licenses are designed to make sure that you
      26   │ have the freedom to distribute copies of free software (and charge for
      27   │ this service if you wish), that you receive source code or can get it
      28   │ if you want it, that you can change the software or use pieces of it
      29   │ in new free programs; and that you know you can do these things.
      30   │
      31   │   To protect your rights, we need to make restrictions that forbid
      32   │ anyone to deny you these rights or to ask you to surrender the rights.
      33   │ These restrictions translate to certain responsibilities for you if
      34   │ you distribute copies of the library, or if you modify it.
      35   │
      36   │   For example, if you distribute copies of the library, whether gratis
      37   │ or for a fee, you must give the recipients all the rights that we gave
      38   │ you.  You must make sure that they, too, receive or can get the source
    

    How did you install bat?

    Through cargo install


    system

    $ uname -srm Darwin 19.3.0 x86_64

    $ sw_vers ProductName: Mac OS X ProductVersion: 10.15.3 BuildVersion: 19D76

    bat

    $ bat --version bat 0.15.0

    $ env

    bat_config

    bat_wrapper

    No wrapper script.

    bat_wrapper_function

    No wrapper function for 'bat'.

    No wrapper function for 'cat'.

    tool

    $ less --version less 487 (POSIX regular expressions)

    bug upstream-error 
    opened by itkovian 31
  • `git log` broken when using bat as pager

    `git log` broken when using bat as pager

    I like using bat as my pager of choice with syntax highlighting! :). Somewhere across the internet I found the command export PAGER='bat --paging=always' to do exactly that.

    Now I realized that my git log did not work anymore (did not show anything) and I found out that it was because of that setting. Setting export PAGER=less and my git log is back.

    Is there a way how to make bat-pager and the git log compatible?

    bug question 
    opened by tbrodbeck 30
  • Bat is not showing his interface with GNU screen

    Bat is not showing his interface with GNU screen

    Hi everyone,

    I am having an issue when I use bat with GNU screen. The problem is that I can not see the grid, line numbers, syntax and many other bat features.

    They can see it in the following screen captures:

    • Without using screen
    Screenshot 2019-12-12 at 09 21 05
    • Using screen
    Screenshot 2019-12-12 at 09 21 21

    Maybe is anything related to the type terminal environment value?

    upstream-error 
    opened by jfagoagas 30
  • bat -p Segfaults on macOS Catalina

    bat -p Segfaults on macOS Catalina

    I get the same segfault when installed via Homebrew as well as cargo install bat

     > uname -a
    Darwin Armstrong.localdomain 19.0.0 Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64 x86_64
    
     > bat --version
    bat 0.12.1
    

    Steps to reproduce:

    bat -p # with any input
    
    Process:               bat [4763]
    Path:                  /Users/USER/*/bat
    Identifier:            bat
    Version:               0
    Code Type:             X86-64 (Native)
    Parent Process:        fish [713]
    Responsible:           alacritty [711]
    User ID:               501
    
    Date/Time:             2019-10-08 11:24:34.261 -0700
    OS Version:            Mac OS X 10.15 (19A583)
    Report Version:        12
    Bridge OS Version:     4.0 (17P572)
    Anonymous UUID:        6CC6A47B-39EF-88AF-67D4-0C1D3FCFDFF0
    
    
    Time Awake Since Boot: 730 seconds
    
    System Integrity Protection: disabled
    
    Crashed Thread:        0  Dispatch queue: com.apple.main-thread
    
    Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes:       EXC_I386_GPFLT
    Exception Note:        EXC_CORPSE_NOTIFY
    
    Termination Signal:    Segmentation fault: 11
    Termination Reason:    Namespace SIGNAL, Code 0xb
    Terminating Process:   exc handler [4763]
    
    Application Specific Information:
    dyld2 mode
    
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   bat                           	0x00000001017970c2 match_at + 1250
    1   bat                           	0x000000010179d360 onig_search_with_param + 2160
    2   bat                           	0x000000010176d6b1 onig::Regex::search_with_param::h4a2ba9521397b8df + 145
    3   bat                           	0x000000010174cf93 syntect::parsing::parser::ParseState::parse_line::ha082d257fdc53148 + 3411
    4   bat                           	0x0000000101759f0a syntect::easy::HighlightLines::highlight::hc4ee6d0038f87c5c + 42
    5   bat                           	0x000000010170ce3b _$LT$bat..printer..InteractivePrinter$u20$as$u20$bat..printer..Printer$GT$::print_line::hf1d17cfd22dd316e + 971
    6   bat                           	0x00000001016fc43a bat::controller::Controller::run::h6430c3ee59245cfc + 2618
    7   bat                           	0x0000000101711e6f bat::main::h5ed4543155eda5e6 + 8207
    8   bat                           	0x00000001016e2fe6 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h18bdc78d30f51494 + 6
    9   bat                           	0x0000000101938a78 std::panicking::try::do_call::h8ffcb2a43dbb732c + 24
    10  bat                           	0x000000010193f6bf __rust_maybe_catch_panic + 31
    11  bat                           	0x00000001019393ee std::rt::lang_start_internal::ha688fd553625ef6f + 542
    12  bat                           	0x0000000101712b79 main + 41
    13  libdyld.dylib                 	0x00007fff72d5c405 start + 1
    
    Thread 0 crashed with X86 Thread State (64-bit):
      rax: 0x0000000000000000  rbx: 0x0000000000000010  rcx: 0x0000000101adb570  rdx: 0x00007ffeee52f900
      rdi: 0x00007fc704e9ae20  rsi: 0x0000000000000000  rbp: 0x00007ffeee530fb0  rsp: 0x00007ffeee52f900
       r8: 0x00007fc704e9ad30   r9: 0x0000000000000000  r10: 0x00007ffeee532a28  r11: 0x00007ffeee52f900
      r12: 0x00007fc704e9ad30  r13: 0x00007fc704e9ad3a  r14: 0x0000000000000000  r15: 0x00007fc704e9ae20
      rip: 0x00000001017970c2  rfl: 0x0000000000010246  cr2: 0x0000000101be3f48
      
    Logical CPU:     0
    Error Code:      0x00000000
    Trap Number:     13
    
    
    Binary Images:
           0x1016cd000 -        0x101ab0fe7 +bat (0) <CE78E092-983D-3861-ACD0-6AD4D8947D34> /Users/USER/*/bat
           0x1025b3000 -        0x10264193f  dyld (732.8) <42C11B81-6928-369F-B03E-D57355572700> /usr/lib/dyld
        0x7fff379a2000 -     0x7fff379a2fff  com.apple.Accelerate (1.11 - Accelerate 1.11) <956D070C-B522-3A08-891A-CAD6BA4082D1> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
        0x7fff379ba000 -     0x7fff38025fdf  com.apple.vImage (8.1 - 524.2) <45A48EA9-49AA-33A0-B830-AF754BD01009> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
        0x7fff38026000 -     0x7fff3828efff  libBLAS.dylib (1303) <112B19CC-925A-3E28-8B32-2002D30A37FA> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
        0x7fff3828f000 -     0x7fff3857efdf  libBNNS.dylib (144.11.2) <A806AED9-837B-3C6C-AB0B-A41983C1CD07> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
        0x7fff38580000 -     0x7fff38925fff  libLAPACK.dylib (1303) <5C248B39-F233-3074-A3A5-AF8F436FBF87> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
        0x7fff38926000 -     0x7fff3893bff8  libLinearAlgebra.dylib (1303) <C21931B4-F6BD-324D-A2D9-F13EE8AFB29E> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
        0x7fff3893c000 -     0x7fff38941ff3  libQuadrature.dylib (7) <826897ED-B7AD-33DC-B9CB-F9787784F312> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
        0x7fff38942000 -     0x7fff389b2fff  libSparse.dylib (103) <55467C29-2096-36AB-8A6D-5231A342809D> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib
        0x7fff389b3000 -     0x7fff389c5fef  libSparseBLAS.dylib (1303) <3244FCAF-A1FE-3248-AF22-BFB3E9D12555> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
        0x7fff389c6000 -     0x7fff38b9fffb  libvDSP.dylib (735) <E849AEB0-2995-38A4-B0C3-4ACEAF434D12> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
        0x7fff38ba0000 -     0x7fff38c5bfd3  libvMisc.dylib (735) <D6248EC4-7772-37BB-87F7-9BAB7F5D31A0> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
        0x7fff38c5c000 -     0x7fff38c5cfff  com.apple.Accelerate.vecLib (3.11 - vecLib 3.11) <79C1A1C7-E97A-3B7A-8737-444B402A7AA0> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
        0x7fff3a387000 -     0x7fff3a6fdffe  com.apple.CFNetwork (1111 - 1111) <642753C5-5D26-3794-9A4C-4F63F226C01A> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
        0x7fff3bbbc000 -     0x7fff3c03bff7  com.apple.CoreFoundation (6.9 - 1671.15) <BF8A8279-9C5E-37C6-8426-90C8182EFBDD> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
        0x7fff3cfa3000 -     0x7fff3cfa3fff  com.apple.CoreServices (1069.2 - 1069.2) <C5F7AABC-BADC-3331-A7D6-9B0A82A23E58> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
        0x7fff3cfa4000 -     0x7fff3d029ff7  com.apple.AE (838 - 838) <7295ED82-7087-3602-9DCA-4FE205F6499C> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
        0x7fff3d02a000 -     0x7fff3d30bfff  com.apple.CoreServices.CarbonCore (1217 - 1217) <7AA0ECB3-0993-3081-A9EC-0365EF72B24D> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
        0x7fff3d30c000 -     0x7fff3d359ff1  com.apple.DictionaryServices (1.2 - 321) <3D0FFBDE-E425-37C7-B780-39A3D024462A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
        0x7fff3d35a000 -     0x7fff3d362ff7  com.apple.CoreServices.FSEvents (1268.0.6 - 1268.0.6) <78D2AB1A-9053-3D32-8C18-C1DD31FF9400> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
        0x7fff3d363000 -     0x7fff3d59bff1  com.apple.LaunchServices (1069.2 - 1069.2) <68B4C10C-D536-33E9-9719-E7BA5B753F2B> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
        0x7fff3d59c000 -     0x7fff3d634ff1  com.apple.Metadata (10.7.0 - 2066.12) <249EA615-8446-3A36-B6B7-ED613C8B8148> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
        0x7fff3d635000 -     0x7fff3d662ff7  com.apple.CoreServices.OSServices (1069.2 - 1069.2) <2FECF3BA-B785-35E2-85E9-2A2267801AA4> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
        0x7fff3d663000 -     0x7fff3d6cafff  com.apple.SearchKit (1.4.1 - 1.4.1) <0068BD72-CF2B-34E4-B461-002D5E56C31C> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
        0x7fff3d6cb000 -     0x7fff3d6efffd  com.apple.coreservices.SharedFileList (131 - 131) <61F62948-4109-38F0-BB91-5EBB6BEEAB10> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
        0x7fff3df44000 -     0x7fff3df4aff7  com.apple.DiskArbitration (2.7 - 2.7) <23104F29-F120-354B-97BE-4514A675BB14> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
        0x7fff3e277000 -     0x7fff3e63eff3  com.apple.Foundation (6.9 - 1671.15) <4BEAB72D-10AA-3009-B0F5-B82B4FE1C441> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
        0x7fff3e990000 -     0x7fff3ea33ffb  com.apple.framework.IOKit (2.0.2 - 1726.11.1) <9E81E92C-7EC2-330F-B0AF-BBFD9D3E46F6> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
        0x7fff42284000 -     0x7fff42290ffe  com.apple.NetFS (6.0 - 4.0) <10ECF7E4-98A5-3751-B7AC-0AAAF0050777> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
        0x7fff44e54000 -     0x7fff44e70fff  com.apple.CFOpenDirectory (10.15 - 220.11.1) <6F4D018B-FA8B-35B2-8120-F8215DDA01CB> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
        0x7fff44e71000 -     0x7fff44e7cfff  com.apple.OpenDirectory (10.15 - 220.11.1) <170173C2-DF22-3D11-914F-465AA7C4760A> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
        0x7fff481fe000 -     0x7fff48542ff9  com.apple.security (7.0 - 59306.11.20) <1B0AE660-0EC5-3497-ACE8-1AF2BB772BAB> /System/Library/Frameworks/Security.framework/Versions/A/Security
        0x7fff48543000 -     0x7fff485cbff7  com.apple.securityfoundation (6.0 - 55236) <903B8365-1F35-3EB2-9821-9D2C440BE2DD> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
        0x7fff48624000 -     0x7fff48628ff8  com.apple.xpc.ServiceManagement (1.0 - 1) <EF42F840-AF78-38A4-B6E1-FDF445CA3477> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
        0x7fff49412000 -     0x7fff4947cff7  com.apple.SystemConfiguration (1.19 - 1.19) <C0C089C3-FC64-3107-B23E-4073E800C5D2> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
        0x7fff4d1d0000 -     0x7fff4d294ff7  com.apple.APFS (1412.11.7 - 1412.11.7) <71DAB6CE-FF14-373D-A183-F388C5D9FE84> /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS
        0x7fff4ec95000 -     0x7fff4eca4fdf  com.apple.AppleFSCompression (119 - 1.0) <725908C4-7585-3AB6-8A1A-691B8A9074B8> /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
        0x7fff50430000 -     0x7fff50439ff3  com.apple.coreservices.BackgroundTaskManagement (1.0 - 104) <156CFAE3-07D0-332C-90BE-BB2E4C893C99> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
        0x7fff5317a000 -     0x7fff5318aff3  com.apple.CoreEmoji (1.0 - 100) <9AB89183-635C-3859-9DC6-7BCE3A94D15E> /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
        0x7fff537d6000 -     0x7fff53840ff8  com.apple.CoreNLP (1.0 - 211) <8F08AEF6-A380-3811-BAF0-D80E7C84B5AD> /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP
        0x7fff54450000 -     0x7fff5447eff7  com.apple.CSStore (1069.2 - 1069.2) <5E3C50AB-9C00-36F3-A986-CE033480CA8B> /System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore
        0x7fff60416000 -     0x7fff604e3ffd  com.apple.LanguageModeling (1.0 - 212) <A9F41C84-E574-3624-8C00-60F228E0FF97> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
        0x7fff604e4000 -     0x7fff6052cff7  com.apple.Lexicon-framework (1.0 - 70) <BEADF30C-37D3-3112-90DA-18A85406DBF3> /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon
        0x7fff60533000 -     0x7fff60537ff6  com.apple.LinguisticData (1.0 - 349) <A392AD13-9AEB-31BB-A9ED-F29437CFBDB4> /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData
        0x7fff61968000 -     0x7fff619b4ff7  com.apple.spotlight.metadata.utilities (1.0 - 2066.12) <989018A3-4BD0-3FD1-9A2D-88FD3A521452> /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities
        0x7fff623d7000 -     0x7fff623e1fff  com.apple.NetAuth (6.2 - 6.2) <90F9ADF4-8A9C-3603-8F55-24F8C472430B> /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
        0x7fff6b072000 -     0x7fff6b082ff3  com.apple.TCC (1.0 - 1) <DCE1D8C7-7BEB-3201-A0E5-38F012E6B1BC> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
        0x7fff6f2c2000 -     0x7fff6f2c4ff3  com.apple.loginsupport (1.0 - 1) <40974390-AFD7-3CEF-8B8D-6219BF916A4E> /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
        0x7fff6f632000 -     0x7fff6f667ff7  libCRFSuite.dylib (48) <45ADF347-A43F-3E95-BF26-94DC525DCC81> /usr/lib/libCRFSuite.dylib
        0x7fff6f66a000 -     0x7fff6f674ff3  libChineseTokenizer.dylib (34) <94E822B6-F850-33C5-888C-D5C8AE12122C> /usr/lib/libChineseTokenizer.dylib
        0x7fff6f701000 -     0x7fff6f703fff  libDiagnosticMessagesClient.dylib (112) <418D550B-C748-3D55-A6D5-0398E032F9F3> /usr/lib/libDiagnosticMessagesClient.dylib
        0x7fff6fbc8000 -     0x7fff6fbc9ff3  libSystem.B.dylib (1281) <66742D2E-591A-32B2-8E92-4A54BEE843F6> /usr/lib/libSystem.B.dylib
        0x7fff6fc59000 -     0x7fff6fc5afff  libThaiTokenizer.dylib (3) <D2A89215-5281-310F-8C75-47F1E6A14F62> /usr/lib/libThaiTokenizer.dylib
        0x7fff6fc72000 -     0x7fff6fc88fff  libapple_nghttp2.dylib (1.39.2) <0A685DAA-9FC6-3C87-83F1-1D11FC87C1F4> /usr/lib/libapple_nghttp2.dylib
        0x7fff6fcbd000 -     0x7fff6fd2fff7  libarchive.2.dylib (72.11.2) <8636AE5A-0CBB-306C-8A4B-2E612D2D6B13> /usr/lib/libarchive.2.dylib
        0x7fff6fdca000 -     0x7fff6fdcaff3  libauto.dylib (187) <AACF68BC-9A05-36F8-8F60-78951422E090> /usr/lib/libauto.dylib
        0x7fff6fe88000 -     0x7fff6fe98fff  libbsm.0.dylib (60) <F03FA480-0B22-3300-833F-03E88F43C504> /usr/lib/libbsm.0.dylib
        0x7fff6fe99000 -     0x7fff6fea5fff  libbz2.1.0.dylib (44) <8B522880-BEF8-3668-B785-F2AB4DE8F366> /usr/lib/libbz2.1.0.dylib
        0x7fff6fea6000 -     0x7fff6fef9fff  libc++.1.dylib (800.6) <328FB687-2363-38B1-AC11-11736925C775> /usr/lib/libc++.1.dylib
        0x7fff6fefa000 -     0x7fff6ff0efff  libc++abi.dylib (800.7) <02753D3D-91C6-3670-8B5D-EBE040B516FC> /usr/lib/libc++abi.dylib
        0x7fff6ff0f000 -     0x7fff6ff0fffb  libcharset.1.dylib (59) <12D52FA5-EBCA-3F3C-A269-1095F268F92F> /usr/lib/libcharset.1.dylib
        0x7fff6ff10000 -     0x7fff6ff21ffb  libcmph.dylib (8) <7DD1F726-F3E3-341A-AFAC-83E9A470883C> /usr/lib/libcmph.dylib
        0x7fff6ff22000 -     0x7fff6ff39fe7  libcompression.dylib (87) <10B82884-BE1A-3A36-9B38-3C92AF566D3E> /usr/lib/libcompression.dylib
        0x7fff701fb000 -     0x7fff70211fff  libcoretls.dylib (167) <1C64EA6F-8E0D-319D-99D4-026150EEB2B2> /usr/lib/libcoretls.dylib
        0x7fff70212000 -     0x7fff70213ffb  libcoretls_cfhelpers.dylib (167) <724B0181-4D9E-3D2F-B1AB-B4FD6A7BAB2C> /usr/lib/libcoretls_cfhelpers.dylib
        0x7fff7093c000 -     0x7fff7093cff3  libenergytrace.dylib (21) <E42B4AFF-3FAC-3CE4-A7BF-48621458B356> /usr/lib/libenergytrace.dylib
        0x7fff70964000 -     0x7fff70966ff7  libfakelink.dylib (149) <FC5712CB-2188-3DAD-8DD4-CC3ECCA3F9A8> /usr/lib/libfakelink.dylib
        0x7fff70975000 -     0x7fff7097afff  libgermantok.dylib (24) <93E95178-E436-3611-A4A3-CB1D42CF4064> /usr/lib/libgermantok.dylib
        0x7fff70980000 -     0x7fff70a70ff7  libiconv.2.dylib (59) <1A648E74-25D4-3F9B-94C4-10B58AD091B7> /usr/lib/libiconv.2.dylib
        0x7fff70a71000 -     0x7fff70cc9ff7  libicucore.A.dylib (64232.0.1) <88E47471-605C-3C86-871B-5D2F4628A936> /usr/lib/libicucore.A.dylib
        0x7fff70ce3000 -     0x7fff70ce4fff  liblangid.dylib (133) <78DF87EE-CDCE-3628-B239-56743169BC93> /usr/lib/liblangid.dylib
        0x7fff70ce5000 -     0x7fff70cfdffb  liblzma.5.dylib (16) <D416FC97-76EC-38B5-A134-85DDFEA9D297> /usr/lib/liblzma.5.dylib
        0x7fff70d15000 -     0x7fff70dbcfff  libmecab.dylib (879) <DD60E6AA-154E-3294-B2C0-3277B754F3BC> /usr/lib/libmecab.dylib
        0x7fff70dbd000 -     0x7fff7101cfe9  libmecabra.dylib (879) <B5BE574C-DD3A-336D-87A3-202CE7803A45> /usr/lib/libmecabra.dylib
        0x7fff714db000 -     0x7fff7194dff6  libnetwork.dylib (1880.11.2) <CC02BF51-A056-3656-B735-E8CD0F4B7B15> /usr/lib/libnetwork.dylib
        0x7fff719eb000 -     0x7fff71a1cfe6  libobjc.A.dylib (779.1) <722C0959-69B8-3843-B5EA-CDD8FAA91D5E> /usr/lib/libobjc.A.dylib
        0x7fff71a2f000 -     0x7fff71a33fff  libpam.2.dylib (25) <86317F48-E926-30AC-AE9F-ABB33543FBC8> /usr/lib/libpam.2.dylib
        0x7fff71a36000 -     0x7fff71a69ff7  libpcap.A.dylib (89.11.2) <65A8EBD2-F059-353B-9538-20D1314EFD89> /usr/lib/libpcap.A.dylib
        0x7fff71aeb000 -     0x7fff71b03ff7  libresolv.9.dylib (67) <06480BFC-6372-3225-B77A-F5AC9969DB64> /usr/lib/libresolv.9.dylib
        0x7fff71b5e000 -     0x7fff71d4bff7  libsqlite3.dylib (308.1) <7033723E-DD65-3AA3-ADCA-8746F7BAD75D> /usr/lib/libsqlite3.dylib
        0x7fff71f9a000 -     0x7fff71f9dffb  libutil.dylib (57) <844B7887-09B3-3D12-ACDE-C4EB8F53DC62> /usr/lib/libutil.dylib
        0x7fff71f9e000 -     0x7fff71fabfff  libxar.1.dylib (420) <E0D7C0A6-76EC-3682-A393-6596D4986269> /usr/lib/libxar.1.dylib
        0x7fff71fb1000 -     0x7fff72093ff7  libxml2.2.dylib (32.12) <C0A87484-D334-3B50-8F8A-A9C63295F49E> /usr/lib/libxml2.2.dylib
        0x7fff72097000 -     0x7fff720bffff  libxslt.1.dylib (16.6) <CD9E79B0-159A-3055-B62A-57AB2B445912> /usr/lib/libxslt.1.dylib
        0x7fff720c0000 -     0x7fff720d2fff  libz.1.dylib (76) <3FC3FC3E-ABF3-3167-9078-B54C952608B4> /usr/lib/libz.1.dylib
        0x7fff72b37000 -     0x7fff72b3cff7  libcache.dylib (83) <8EC69760-6DAA-3068-9372-F1D554C548E5> /usr/lib/system/libcache.dylib
        0x7fff72b3d000 -     0x7fff72b48ff7  libcommonCrypto.dylib (60165) <698BE754-137D-361D-B826-57B8DD969E4A> /usr/lib/system/libcommonCrypto.dylib
        0x7fff72b49000 -     0x7fff72b50fff  libcompiler_rt.dylib (101.2) <0BE7F119-C9C2-3612-A3F4-2336D4444476> /usr/lib/system/libcompiler_rt.dylib
        0x7fff72b51000 -     0x7fff72b5aff7  libcopyfile.dylib (166) <B5E73B1C-0BCF-33FE-80A1-D9E3BA3033D4> /usr/lib/system/libcopyfile.dylib
        0x7fff72b5b000 -     0x7fff72bf2fc3  libcorecrypto.dylib (866.0.10) <58344B13-CD10-3697-A516-6F5B06DD1EB7> /usr/lib/system/libcorecrypto.dylib
        0x7fff72d09000 -     0x7fff72d4aff0  libdispatch.dylib (1173.0.3) <F4260D89-F67D-30CB-AF61-7ED25CB687DB> /usr/lib/system/libdispatch.dylib
        0x7fff72d4b000 -     0x7fff72d80fff  libdyld.dylib (732.8) <98960E27-A08B-36DA-A5CB-8538B2D6757E> /usr/lib/system/libdyld.dylib
        0x7fff72d81000 -     0x7fff72d81ffb  libkeymgr.dylib (30) <682B41BC-BDC2-38D5-8820-87099606FA12> /usr/lib/system/libkeymgr.dylib
        0x7fff72d82000 -     0x7fff72d8eff7  libkxld.dylib (6153.11.26) <53BE9630-BDC8-3649-8709-7A4F86777B1A> /usr/lib/system/libkxld.dylib
        0x7fff72d8f000 -     0x7fff72d8fff7  liblaunch.dylib (1738.11.1) <7FE11F0D-65BC-3726-B1DD-E84F329193E0> /usr/lib/system/liblaunch.dylib
        0x7fff72d90000 -     0x7fff72d95ff7  libmacho.dylib (949.0.1) <163DFE06-2FAD-3CBC-80EF-C38EED6AEA52> /usr/lib/system/libmacho.dylib
        0x7fff72d96000 -     0x7fff72d98ff3  libquarantine.dylib (110.0.4) <C8F39330-8CB5-30B0-8564-96453DCEFAD7> /usr/lib/system/libquarantine.dylib
        0x7fff72d99000 -     0x7fff72d9aff7  libremovefile.dylib (48) <FB280185-B5ED-3F08-B08A-A378865C1398> /usr/lib/system/libremovefile.dylib
        0x7fff72d9b000 -     0x7fff72db2fff  libsystem_asl.dylib (377.0.1) <30CE9DAF-B1FA-3510-832B-F1CE19933ED7> /usr/lib/system/libsystem_asl.dylib
        0x7fff72db3000 -     0x7fff72db3fff  libsystem_blocks.dylib (74) <E0B8C825-E62B-357E-A2A0-13776F0A0F8C> /usr/lib/system/libsystem_blocks.dylib
        0x7fff72db4000 -     0x7fff72e3bff7  libsystem_c.dylib (1353.11.2) <2A5BFAFE-8214-3B35-AD46-C07A1A8B8941> /usr/lib/system/libsystem_c.dylib
        0x7fff72e3c000 -     0x7fff72e3ffff  libsystem_configuration.dylib (1061.0.2) <56174463-22ED-337F-B0D4-94995DCDB9B7> /usr/lib/system/libsystem_configuration.dylib
        0x7fff72e40000 -     0x7fff72e43ff7  libsystem_coreservices.dylib (114) <01695913-028E-3AE1-8D4E-2B2769109811> /usr/lib/system/libsystem_coreservices.dylib
        0x7fff72e44000 -     0x7fff72e4bfff  libsystem_darwin.dylib (1353.11.2) <4CE52C63-87AA-3C6D-899F-8C983E5FC061> /usr/lib/system/libsystem_darwin.dylib
        0x7fff72e4c000 -     0x7fff72e53ffb  libsystem_dnssd.dylib (1096.0.2) <DC7381E8-F09F-3441-8267-9B8F50A0EBA9> /usr/lib/system/libsystem_dnssd.dylib
        0x7fff72e54000 -     0x7fff72e55ffb  libsystem_featureflags.dylib (17) <DBCA4AA2-CA05-38D5-AB4B-BE0F3E09BB8B> /usr/lib/system/libsystem_featureflags.dylib
        0x7fff72e56000 -     0x7fff72ea3ff7  libsystem_info.dylib (538) <9F9D6368-A11E-32F1-9BB5-C153F42EFED8> /usr/lib/system/libsystem_info.dylib
        0x7fff72ea4000 -     0x7fff72ed0fff  libsystem_kernel.dylib (6153.11.26) <4CE9D54A-A975-348E-B878-EE74EDFC956B> /usr/lib/system/libsystem_kernel.dylib
        0x7fff72ed1000 -     0x7fff72f18ff7  libsystem_m.dylib (3178) <4F516261-0C0E-3105-AF35-EF39D6347B50> /usr/lib/system/libsystem_m.dylib
        0x7fff72f19000 -     0x7fff72f40fff  libsystem_malloc.dylib (283) <02925539-3CBA-39EB-BA6B-9A936CFA0BF8> /usr/lib/system/libsystem_malloc.dylib
        0x7fff72f41000 -     0x7fff72f4eff3  libsystem_networkextension.dylib (1095.11.9) <8B5EE189-E3D1-31FD-878F-50286B6E7047> /usr/lib/system/libsystem_networkextension.dylib
        0x7fff72f4f000 -     0x7fff72f58fff  libsystem_notify.dylib (241) <89381127-2A07-3F07-B865-358FACCF9102> /usr/lib/system/libsystem_notify.dylib
        0x7fff72f59000 -     0x7fff72f62fe7  libsystem_platform.dylib (220) <90E508E4-46D8-33FF-8552-DDAA079977A0> /usr/lib/system/libsystem_platform.dylib
        0x7fff72f63000 -     0x7fff72f6dfff  libsystem_pthread.dylib (416.11.1) <2EA6F95F-F264-30B6-8AF2-24197B5AED84> /usr/lib/system/libsystem_pthread.dylib
        0x7fff72f6e000 -     0x7fff72f72ffb  libsystem_sandbox.dylib (1217.11.16) <51129CBB-BC46-37F1-A1B5-ECFA9530704D> /usr/lib/system/libsystem_sandbox.dylib
        0x7fff72f73000 -     0x7fff72f75fff  libsystem_secinit.dylib (62.0.4) <A48D9AF3-75F2-3331-A0C8-0A23771F4AC7> /usr/lib/system/libsystem_secinit.dylib
        0x7fff72f76000 -     0x7fff72f7dffb  libsystem_symptoms.dylib (1238.0.2) <08E8CF75-5F77-3475-A48E-A01CBDF09173> /usr/lib/system/libsystem_symptoms.dylib
        0x7fff72f7e000 -     0x7fff72f94ff2  libsystem_trace.dylib (1147.0.3) <5836645E-9862-326D-AB3B-A19E76BE29B9> /usr/lib/system/libsystem_trace.dylib
        0x7fff72f96000 -     0x7fff72f9bffb  libunwind.dylib (35.4) <F5AE1D43-7C5F-3BA2-94D3-E769F82C0F61> /usr/lib/system/libunwind.dylib
        0x7fff72f9c000 -     0x7fff72fd0ff6  libxpc.dylib (1738.11.1) <2E9076CD-6C0E-38B6-8403-B2DDCE125FBF> /usr/lib/system/libxpc.dylib
    
    External Modification Summary:
      Calls made by other processes targeting this process:
        task_for_pid: 0
        thread_create: 0
        thread_set_state: 0
      Calls made by this process:
        task_for_pid: 0
        thread_create: 0
        thread_set_state: 0
      Calls made by all processes on this machine:
        task_for_pid: 497
        thread_create: 0
        thread_set_state: 0
    
    VM Region Summary:
    ReadOnly portion of Libraries: Total=418.9M resident=0K(0%) swapped_out_or_unallocated=418.9M(100%)
    Writable regions: Total=85.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=85.1M(100%)
     
                                    VIRTUAL   REGION 
    REGION TYPE                        SIZE    COUNT (non-coalesced) 
    ===========                     =======  ======= 
    Kernel Alloc Once                    8K        1 
    MALLOC                            76.8M       31 
    MALLOC guard page                   16K        4 
    Stack                             8188K        1 
    Stack Guard                       56.0M        1 
    VM_ALLOCATE                        132K        2 
    __DATA                            6009K      121 
    __DATA_CONST                       188K        2 
    __LINKEDIT                       348.9M        3 
    __OBJC_RO                         31.8M        1 
    __OBJC_RW                         1764K        2 
    __TEXT                            70.0M      121 
    __UNICODE                          564K        1 
    shared memory                        8K        2 
    ===========                     =======  ======= 
    TOTAL                            600.0M      293 
    
    bug help wanted upstream-error 
    opened by davidarmstronglewis 30
  • Default theme compatible with light/dark terminals

    Default theme compatible with light/dark terminals

    Hi! 👋 First of all, thanks for making such a great tool!

    One reason preventing me from using bat much is because there's no theme that's readable on both light and dark terminals. For instance, the default theme shows text as white, which is invisible on a white background.

    I think this might be fairly common use case, as macOS' default terminal theme automatically switches between light/dark as the system theme changes.

    I wonder if there's any plans of making the default theme compatible with both types of terminals? I think one major improvement would be to show text in the default text color, instead of white.

    I'd be happy to help if this would seem reasonable.

    feature-request 
    opened by hoffa 29
  • Mouse wheel support in x-terminals

    Mouse wheel support in x-terminals

    Hi. I've been using "less" for years and it supports the mouse wheel for scrolling up and down the displayed text. Could it also be added to bat ?

    duplicate question documentation 
    opened by tnemeth 29
  • manpages formatting looks misplaced

    manpages formatting looks misplaced

    Describe the bug you encountered:

    when using bat as pager for manpages the formatting is bit misplaced.

    What did you expect to happen instead?

    formatting should be similar to less

    share share1

    How did you install bat? nix-env -iA nixos.bat


    bat version and environment

    Software version

    bat 0.18.1 ()

    Operating system

    Linux 5.10.40

    Command-line

    /home/creator54/.nix-profile/bin/bat --diagnostic 
    

    Environment variables

    SHELL=/run/current-system/sw/bin/fish
    PAGER=bat
    LESS=<not set>
    BAT_PAGER=<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=truecolor
    NO_COLOR=<not set>
    MANPAGER=<not set>
    

    Config file

    --theme="Dracula"
    

    Compile time information

    • Profile: release
    • Target triple: x86_64-unknown-linux-gnu
    • Family: unix
    • OS: linux
    • Architecture: x86_64
    • Pointer width: 64
    • Endian: little
    • CPU features: fxsr,sse,sse2
    • Host: x86_64-unknown-linux-gnu

    Less version

    > less --version 
    less 563 (POSIX regular expressions)
    Copyright (C) 1984-2020  Mark Nudelman
    
    less comes with NO WARRANTY, to the extent permitted by law.
    For information about the terms of redistribution,
    see the file named README in the less distribution.
    Home page: http://www.greenwoodsoftware.com/less
    
    bug 
    opened by Creator54 25
  • Default pager breaks colours in Windows Terminal

    Default pager breaks colours in Windows Terminal

    Hi, I've run into a bug in less that effectively breaks bat in the new Windows Terminal. I appreciate that this is not bat's fault, but I'm reporting it here to save other people the investigation time.

    Bug

    When calling bat in PowerShell in Windows Terminal, it breaks subsequent colouring in the terminal and makes it unusable (at least with my colour scheme) until the terminal is relaunched:

    image

    Details

    This occurs for me in PowerShell (7 and 5.1) in Windows Terminal, it does not occur in the old Windows PowerShell application.

    I believe this is due to a bug in version 551 of the less pager, which is installed by default with the bat Chocolatey package. The issue has been fixed in less source, but it's not available via Windows package managers yet.

    Short-term workaround

    I was able to fix the issue by compiling version 554 of less, using the MinGW compilation instructions here.

    Long-term fix

    Wait for a newer version of less to be released via Chocolatey and Scoop.

    What version of bat are you using? bat 0.12.1 and less 551

    How did you install bat? Chocolatey


    Windows 10 1909

    bug windows upstream-error 
    opened by rgwood 24
  • Add a theme that uses terminal colors

    Add a theme that uses terminal colors

    I spent a lot of time to customize my terminal named colors, and I wish there was a bat theme that uses them so it doesn’t look bad in my terminal.

    The benefit is that it provides a backup theme that works across terminals if no other theme works with the terminal theme.

    help wanted question themes 
    opened by ariasuni 23
Releases(v0.22.1)
Owner
David Peter
David Peter
A cat(1) clone with syntax highlighting and Git integration.

A cat(1) clone with syntax highlighting and Git integration. Key Features • How To Use • Installation • Customization • Project goals, alternatives [中

David Peter 38.9k Jan 8, 2023
A service for helping your cat find other cats

Check back later! Discord Self-hosting This is an open-source service! Feel free to host you own private instances. All we ask is you credit us and li

ibx34 4 Oct 31, 2021
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

Renan Fernandes 2 Mar 5, 2022
A tongue-in-cheek GUI that provides similar functionality to GNU cat

catboy a tongue-in-cheek GUI that provides similar functionality to GNU cat information: Attribute Value Development Status: Active Neglect Price: I h

toasterrepairman 2 Feb 9, 2022
Chaos Cat brings destruction and suffering to your software

Chaos Cat brings destruction and suffering to your software. When Chaos Cat is loaded it will randomly make predefined syscalls fail. This tests your software for the the things you might have forgotten to check because operating systems usually Just Work™ and syscalls usually never fail.

Ossi Herrala 2 Oct 8, 2022
Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim.

cat.nvim Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim. Failed as I realized far too late, that

James Vero 4 Aug 5, 2022
Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.

smartcat (sc) Puts a brain behind cat! CLI interface to bring language models in the Unix ecosystem and allow power users to make the most out of llms

Emilien Fugier 28 Dec 2, 2023
SQLite clone from scratch in Rust

Rust-SQLite (SQLRite) Rust-SQLite, aka SQLRite , is a simple embedded database modeled off SQLite, but developed with Rust. The goal is get a better u

João Henrique Machado Silva 952 Jan 5, 2023
ShaderToy clone in Rust, currently supporting MacOS.

ShaderRoy ShaderToy clone in Rust, currently supporting MacOS. Features cargo run <rust project dir> displays a single macOS window filled with a Meta

Michal Srb 24 Dec 11, 2022
Cheat engine clone attempt

betrayal_engine Cheat engine clone attempt running # first terminal cargo run --example test-program # runs a test program #second terminal ps -aux |

Wojciech Niedźwiedź 3 Nov 8, 2021
An official Sudachi clone in Rust (incomplete) 🦀

2021-07-07 UPDATE: The official Sudachi team will take over this project (cf. 日本語形態素解析器 SudachiPy の 現状と今後について - Speaker Deck) sudachi.rs An official S

Works Applications 173 Dec 29, 2022
A small tool to clone git repositories to a standard location, organised by domain name and path.

A small tool to clone git repositories to a standard location, organised by domain name and path. Runs on BSD, Linux, macOS, Windows, and more.

Wesley Moore 68 Dec 19, 2022
A fast, resilient, isomorphic hacker news clone in ~1k lines of rust.

Hackernews sauron A hacker news clone in ~1k lines of rust. This is using sauron web-framework. Feature Isomorphic Completely identical server-side re

Jovansonlee Cesar 102 Nov 19, 2022
A highly customizable snake clone made in Rust with the Bevy engine, named after the Japanese word for snake, 蛇.

Hebi ?? A highly customizable snake clone made in Rust with the Bevy engine, named after the Japanese word for snake, 蛇(へび). Configuration One of the

Elnu 79 Dec 7, 2022
An example repository on how to start building graph applications on streaming data. Just clone and start building 💻 💪

An example repository on how to start building graph applications on streaming data. Just clone and start building ?? ??

Memgraph 40 Dec 20, 2022
A lightweight microkernel/IPC based operating system built with Rust which is not a clone of any existing operating system

Noble Operating System Noble is a lightweight microkernel and IPC based operating system built with Rust which is not a clone of any existing operatin

Revolution Xenon 3 Jan 10, 2022
A toy-clone of ping

Rong Ping is a simple command that is used to check the liveness of a server. Ping measures the round-trip time for messages sent from the originating

Sherub Thakur 9 Dec 27, 2021
clone of grep cli written in Rust. From Chapter 12 of the Rust Programming Language book

minigrep is a clone of the grep cli in rust Minigrep will find a query string in a file. To test it out, clone the project and run cargo run body poem

Raunak Singh 1 Dec 14, 2021
An official Sudachi clone in Rust 🦀

sudachi.rs - English README 2021-12-09 UPDATE: 0.6.2 Release Try it: pip install --update 'sudachipy>=0.6.2' sudachi.rs is a Rust implementation of Su

Works Applications 175 Dec 30, 2022
Wordlet - a command line clone of Wordle, written in Rust.

Wordlet Wordlet is a command line clone of Wordle, written in Rust. Installation $ cargo install wordlet Usage After installation, start Wordlet by ty

Scott Luptowski 55 Oct 22, 2022