What is the `"st"` file?
roguh opened this issue · 9 comments
Hello, I couldn't find anything about an st
file that bat
seems to generate on my laptop. Perhaps it's due to something in my setup. First, I open a file with bat
and then I get this message after I try to open another file with bat
in the same $PWD
:
Warning: "st" exists; Overwrite, Append, Don't log, or Quit?
Feel free to close this issue if it's not a bug or I missed something in the docs.
I personally have never seen bat
generate a file called st
before, nor seen this warning. Happy to try help solve it here though, in case others encounter the same thing in future and find this issue :)
perhaps you can run bat --diagnostics
and share the output.
Thank you! I'll keep poking around just in case others need help with this problem. Clever that it generates markdown :)
$ bat --diagnostics
Software version
bat 0.24.0 (fc95468)
Operating system
Linux 6.6.19-1-MANJARO
Command-line
bat --diagnostics
Environment variables
SHELL=/usr/bin/fish
PAGER=most
LESS=most
LANG=fr_FR.UTF-8
LC_ALL=<not set>
BAT_PAGER=<not set>
BAT_PAGING=<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=most
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/felina/.config/bat/config': No such file or directory (os error 2).
Custom assets metadata
Could not read contents of '/home/felina/.cache/bat/metadata.yaml': No such file or directory (os error 2).
Custom assets
'/home/felina/.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 643 (PCRE2 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
I did try PAGER=less bat ...
but got the same error.
I am running the kitty
terminal emulator, I'm not sure if that's printed by the diagnostics flag.
Does the same thing happen if you invoke most
or less
on a file directly without bat
?
Or using cat
and piping into less
/ most
?
Nope. I haven't had time to keep investigating. It might be something unusual in some configuration for other programs, maybe something is inadvertently modifying bat's config.
Mar 08 14:18
~ $ echo howdy > test.txt
Mar 08 14:18
~ $ echo howdy2 > test2.txt
Mar 08 14:18
~ $ cat test.txt | most
Mar 08 14:18
~ $ cat test2.txt | most
Mar 08 14:18
~ $ most test.txt
Mar 08 14:18
~ $ most test2.txt
Mar 08 14:18
~ $ cat test.txt | less
Mar 08 14:19
~ $ cat test2.txt | less
I ran bat
with strace
and still cannot find where this st
file is coming from. I see bat
opens some files from /etc/ssl, which is odd. I assume that's with the openssl dependency.
4:openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
5:fstat(3, {st_mode=S_IFREG|0644, st_size=194103, ...}) = 0
8:openat(AT_FDCWD, "/usr/lib/libgit2.so.1.7", O_RDONLY|O_CLOEXEC) = 3
10:fstat(3, {st_mode=S_IFREG|0755, st_size=1250632, ...}) = 0
18:openat(AT_FDCWD, "/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
20:fstat(3, {st_mode=S_IFREG|0644, st_size=728120, ...}) = 0
26:openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
28:fstat(3, {st_mode=S_IFREG|0755, st_size=969008, ...}) = 0
34:openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
37:fstat(3, {st_mode=S_IFREG|0755, st_size=1965296, ...}) = 0
45:openat(AT_FDCWD, "/usr/lib/libssl.so.3", O_RDONLY|O_CLOEXEC) = 3
47:fstat(3, {st_mode=S_IFREG|0755, st_size=914736, ...}) = 0
53:openat(AT_FDCWD, "/usr/lib/libcrypto.so.3", O_RDONLY|O_CLOEXEC) = 3
55:fstat(3, {st_mode=S_IFREG|0755, st_size=5436168, ...}) = 0
62:openat(AT_FDCWD, "/usr/lib/libhttp_parser.so.2.9", O_RDONLY|O_CLOEXEC) = 3
64:fstat(3, {st_mode=S_IFREG|0755, st_size=42696, ...}) = 0
72:openat(AT_FDCWD, "/usr/lib/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
74:fstat(3, {st_mode=S_IFREG|0755, st_size=633072, ...}) = 0
80:openat(AT_FDCWD, "/usr/lib/libssh2.so.1", O_RDONLY|O_CLOEXEC) = 3
82:fstat(3, {st_mode=S_IFREG|0755, st_size=293288, ...}) = 0
88:openat(AT_FDCWD, "/usr/lib/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
90:fstat(3, {st_mode=S_IFREG|0755, st_size=100296, ...}) = 0
129:openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
131:fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
142:openat(AT_FDCWD, "/etc/bat/config", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
143:openat(AT_FDCWD, "/home/$USER/.config/bat/config", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
167:openat(AT_FDCWD, "/home/$USER/.cache/bat/metadata.yaml", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
170:openat(AT_FDCWD, "/home/$USER/.cache/bat/themes.bin", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
173:openat(AT_FDCWD, "/dev/null", O_RDONLY|O_CLOEXEC) = 3
214:openat(AT_FDCWD, ".aliases", O_RDONLY|O_CLOEXEC) = 3
238:openat(AT_FDCWD, "/etc/ssl/openssl.cnf", O_RDONLY) = 5
239:fstat(5, {st_mode=S_IFREG|0644, st_size=12328, ...}) = 0
240:read(5, "#\n# OpenSSL example configuratio"..., 4096) = 4096
271:openat(AT_FDCWD, "/etc/ssl/cert.pem", O_RDONLY) = 5
272:fstat(5, {st_mode=S_IFREG|0444, st_size=225535, ...}) = 0
345:newfstatat(AT_FDCWD, "/home/$USER/.aliases/.git", 0x7ffc3a6f26d0, 0) = -1 ENOTDIR (N'est pas un dossier)
346:newfstatat(AT_FDCWD, "/home/$USER/.aliases", {st_mode=S_IFREG|0644, st_size=1384, ...}, 0) = 0
347:newfstatat(AT_FDCWD, "/home/$USER/.git", 0x7ffc3a6f26d0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
348:newfstatat(AT_FDCWD, "/home/$USER", {st_mode=S_IFDIR|0700, st_size=4096, ...}, 0) = 0
349:newfstatat(AT_FDCWD, "/home/$USER/commondir", 0x7ffc3a6f24d0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
350:newfstatat(AT_FDCWD, "/home/$USER/HEAD", 0x7ffc3a6f24d0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
351:newfstatat(AT_FDCWD, "/home/.git", 0x7ffc3a6f26d0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
352:newfstatat(AT_FDCWD, "/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
353:newfstatat(AT_FDCWD, "/home/commondir", 0x7ffc3a6f24d0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
354:newfstatat(AT_FDCWD, "/home/HEAD", 0x7ffc3a6f24d0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce nom)
Ah, I found it. I had set all of these variables to replace less
with most
as much as possible:
set_global PAGER less
set_global LESS $PAGER
set_global MANPAGER $PAGER
set_global SYSTEMD_PAGER $PAGER
alias less=$PAGER
Removing this fixes bat :)
Also running bat
without the pager bat -P
or by explicitly specifying most/less as my pager :) bat --pager most
.
I'll throw that into my aliases.
Thanks!