You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run touch /tmp/A—B가, where ‘—’ is a multibyte UTF-8 character and ’가’ is a multibyte double-width CJK character.
Run bat --terminal-width=30 /tmp/A—B가.
What happens?
bat crashes:
thread 'main' panicked at /usr/src/debug/rust/rustc-1.84.0-src/library/core/src/str/mod.rs:648:21:
byte index 21 is not a char boundary; it is inside '가' (bytes 20..23) of `File: /tmp/A—B가 <EMPTY>`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
───────┬──────────────────────
Different widths give different results:
with 26 or 27, it crashes with the boundary inside ‘—’;
with 21 or 22, it doesn’t crash but ANSI colour codes are broken: 146;131;116m│ m <EMPTY>.
What did you expect to happen instead?
Depending on the width, either not crashing or not breaking ANSI colour codes.
Could not read contents of '/etc/bat/config': No such file or directory (os error 2).
Config file
--theme=gruvbox-dark
Custom assets metadata
Could not read contents of '/home/vejkse/.cache/bat/metadata.yaml': No such file or directory (os error 2).
Custom assets
'/home/vejkse/.cache/bat' not found
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 668 (PCRE2 regular expressions)
Copyright (C) 1984-2024 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
The text was updated successfully, but these errors were encountered:
What steps will reproduce the bug?
touch /tmp/A—B가
, where ‘—’ is a multibyte UTF-8 character and ’가’ is a multibyte double-width CJK character.bat --terminal-width=30 /tmp/A—B가
.What happens?
bat
crashes:Different widths give different results:
146;131;116m│ m <EMPTY>
.What did you expect to happen instead?
Depending on the width, either not crashing or not breaking ANSI colour codes.
How did you install
bat
?I’m using the latest ArchLinux package.
bat version and environment
Software version
bat 0.25.0 (v0.25.0-modified)
Operating system
Linux 6.13.5-arch1-1
Command-line
Environment variables
System Config file
Could not read contents of '/etc/bat/config': No such file or directory (os error 2).
Config file
Custom assets metadata
Could not read contents of '/home/vejkse/.cache/bat/metadata.yaml': No such file or directory (os error 2).
Custom assets
'/home/vejkse/.cache/bat' not found
Compile time information
Less version
The text was updated successfully, but these errors were encountered: