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
❯ cd ~/Documents/
❯ mkdir bat-error
❯ cd bat-error/
❯ touch a.txt b.txt c.txt
❯ echo "An apple a day keeps the doctor away." >> a.txt
❯ echo "The quick brown fox jumps over the lazy dog." >> b.txt
❯ echo "The five boxing wizards jump quickly at dawn" >> c.txt
❯ rg --glob '*.txt' "brown fox" | fzf --preview-window=top,wrap --preview 'bat --color=always "{}"'
What happens?
fzf's preview window shows:
[bat error]: ''b.txt:The quick brown fox jumps over the lazy dog.'': No such file or directory (os error 2)
...
What did you expect to happen instead?
For the preview window to show the filename and the matched line in the fzf preview window without the error.
...
# 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 Arduino .ino files
--map-syntax "*.ino:C++"
CPU features: aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh
Host: aarch64-apple-darwin
Less version
> less --version
less 581.2 (POSIX regular expressions)
Copyright (C) 1984-2021 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
By setting the --delimiter flag to :, and using the first field index expression {1}, the file name will be correctly passed to bat. Quoting the placeholder is not needed, fzf does it for you.
What steps will reproduce the bug?
What happens?
fzf's preview window shows:
[bat error]: ''b.txt:The quick brown fox jumps over the lazy dog.'': No such file or directory (os error 2)
...
What did you expect to happen instead?
For the preview window to show the filename and the matched line in the fzf preview window without the error.
...
How did you install
bat
?homebrew
bat version and environment
]❯ bat --diagnostic
Software version
bat 0.24.0
Operating system
macOS 15.0.1 (Darwin 24.0.0)
Command-line
Environment variables
System Config file
Config file
Custom assets metadata
Custom assets
Compile time information
Less version
Could this error be similar to #2628?
The text was updated successfully, but these errors were encountered: