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
get into any folder with some files and execute ls | cat -n | less it should give output with numbers (as the cat man page says -n for number all output lines)
1 bar
2 foo
(END)
NOTE: even if we don't pipe it with less it will give the same output. (This is where the incompatibility comes in)
Doing the same thing with bat ls | bat -n | less omits the numbers and prints
bar
foo
(END)
while when I don't pipe the same command in less it outputs the following
1 bar
2 foo
What did you expect to happen instead?
As bat meant to be a cat(1) clone I assume the behavior should be consistent (same in both the cases as cat).
It should not remove the number lines when it is called with the --number|-n flag even while piping into other command such as less.
Could not read contents of '/etc/bat/config': No such file or directory (os error 2).
Config file
Could not read contents of '/home/ag/.config/bat/config': No such file or directory (os error 2).
Custom assets metadata
Could not read contents of '/home/ag/.cache/bat/metadata.yaml': No such file or directory (os error 2).
Custom assets
'/home/ag/.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 633 (POSIX regular expressions)
Copyright (C) 1984-2023 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?
ls | cat -n | less
it should give output with numbers (as thecat
man page says-n
for number all output lines)NOTE: even if we don't pipe it with
less
it will give the same output. (This is where the incompatibility comes in)ls | bat -n | less
omits the numbers and printswhile when I don't pipe the same command in
less
it outputs the followingWhat did you expect to happen instead?
As
bat
meant to be acat(1) clone
I assume the behavior should be consistent (same in both the cases ascat
).It should not remove the number lines when it is called with the
--number|-n
flag even while piping into other command such asless
.How did you install
bat
?bat version and environment
Software version
bat 0.24.0
Operating system
Linux 6.8.4-200.fc39.x86_64
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
Could not read contents of '/home/ag/.config/bat/config': No such file or directory (os error 2).
Custom assets metadata
Could not read contents of '/home/ag/.cache/bat/metadata.yaml': No such file or directory (os error 2).
Custom assets
'/home/ag/.cache/bat' not found
Compile time information
Less version
The text was updated successfully, but these errors were encountered: