Skip to content

bat no longer works in gitbash/msys after upgrade to Windows 11 #3475

@embix

Description

@embix

What steps will reproduce the bug?

  1. have a working bat (0.26.0) in gitbash on windows 10
  2. step 2 upgrade to windows 11
  3. use bat in gitbash: fails
  4. upgrade to latest rust, force reinstall bat in gitbash via cargo install --force bat
  5. use fresh 0.26 bat in gitbash on windows 11: still fails

What happens?

When I use a simplistic test file test.md

# test

and type bat test.md I just get a new promp line in bash, as if I just typed enter/return instead of a command:

08:10:01 embix@DEV temp → cat test.md
# test
08:10:13 embix@DEV temp → bat test.md
08:10:20 embix@DEV temp → echo $?
0

However, in powershell/WindowsTerminal it works as expected:

C:\temp
❯ cat .\test.md
# test

C:\temp
❯ bat test.md
─────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     │ File: test.md
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ # test
─────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────

C:\temp
❯

What did you expect to happen instead?

I expected bat to work in gitbash as well as in Windows native-ishy terminals/shells like powershell and cmd.

How did you install bat?

via cargo


bat version and environment

v0.26.0, Windows 11 (x86_x64), gitbash

output of diagnostic in gitbash (Click to expand)

bat --diagnostic

Software version

bat 0.26.0

Operating system

  • OS: Windows 11 Enterprise N
  • Kernel: 26200

Command-line

'C:\Users\embix\.cargo\bin\bat.exe' --diagnostic

Environment variables

BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_PAGER=<not set>
BAT_PAGING=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
COLORTERM=<not set>
LANG=<not set>
LC_ALL=<not set>
LESS=-R
MANPAGER=<not set>
NO_COLOR=<not set>
PAGER=less
SHELL='C:\Program Files\Git\usr\bin\bash.exe'
TERM=xterm
XDG_CACHE_HOME=<not set>
XDG_CONFIG_HOME=<not set>

System Config file

Could not read contents of 'C:\ProgramData\bat\config': The system cannot find the path specified. (os error 3).

Config file

Could not read contents of 'C:\Users\embix\AppData\Roaming\bat\config': The system cannot find the path specified. (os error 3).

Custom assets metadata

Could not read contents of 'C:\Users\embix\AppData\Local\bat\metadata.yaml': The system cannot find the path specified. (os error 3).

Custom assets

'C:\Users\embix\AppData\Local\bat' not found

Compile time information

  • Profile: release
  • Target triple: x86_64-pc-windows-msvc
  • Family: windows
  • OS: windows
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: cmpxchg16b,fxsr,sse,sse2,sse3
  • Host: x86_64-pc-windows-msvc

Less version

> C:\Program Files\Git\usr\bin\less.exe --version
less 679 (PCRE2 regular expressions)
Copyright (C) 1984-2025  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: https://greenwoodsoftware.com/less
output of diagnostic in powershell/WindowsTerminal (Click to expand)

Software version

bat 0.26.0

Operating system

  • OS: Windows 11 Enterprise N
  • Kernel: 26200

Command-line

C:\Users\embix\.cargo\bin\bat.exe --diagnostic

Environment variables

BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_PAGER=<not set>
BAT_PAGING=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
COLORTERM=<not set>
LANG=<not set>
LC_ALL=<not set>
LESS=<not set>
MANPAGER=<not set>
NO_COLOR=<not set>
PAGER=<not set>
SHELL=<not set>
TERM=<not set>
XDG_CACHE_HOME=<not set>
XDG_CONFIG_HOME=<not set>

System Config file

Could not read contents of 'C:\ProgramData\bat\config': The system cannot find the path specified. (os error 3).

Config file

Could not read contents of 'C:\Users\embix\AppData\Roaming\bat\config': The system cannot find the path specified. (os error 3).

Custom assets metadata

Could not read contents of 'C:\Users\embix\AppData\Local\bat\metadata.yaml': The system cannot find the path specified. (os error 3).

Custom assets

'C:\Users\embix\AppData\Local\bat' not found

Compile time information

  • Profile: release
  • Target triple: x86_64-pc-windows-msvc
  • Family: windows
  • OS: windows
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: cmpxchg16b,fxsr,sse,sse2,sse3
  • Host: x86_64-pc-windows-msvc

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions