Comments (7)
I would look into this, can you assign it to me please.
from bat.
In the meantime, I tried to reproduce the issue, but I could not replicate the same behavior as @FlashSheridan .
Using the ubuntu:jammy container, I verified that less is not present, and then running your command resulted in:
root@test:/# less
bash: less: command not found
root@test:/# batcat -V
bat 0.19.0
root@test:/# batcat --generate-config-file
Success! Config file written to /root/.config/bat/config
root@test:/# batcat /root/.config/bat/config
│ File: /root/.config/bat/config
───────┼────────────
1 │ # This is `bat`s configuration file. Each line either contains a comment or
2 │ # a command-line option that you want to pass to `bat` by default. You can
3 │ # run `bat --help` to get a list of all possible configuration options.
4 │
5 │ # Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
6 │ # for a list of all available themes
7 │ #--theme="TwoDark"
...
In my case, bat defaults correctly to not using a pager if less is not present.
Could it be that somehow no argument is received, causing bat to hang and wait for stdin as it normally does?
from bat.
I used your image, tried to have different permissions for less, played around with bat config but the results were the same.
I will try to tamper the code maybe something pops up.
from bat.
(a minimal Docker image in my case with 22.04.4 LTS (Jammy Jellyfish) x86_64,
In the meantime, I tried to reproduce the issue, but I could not replicate the same behavior as @FlashSheridan . Using the ubuntu:jammy container, …
Hmm, there could well be something else unusual about our company’s minimal Docker image. Attached is the relevant part of the session in which I created the container and encountered the problem. We’re in the process of open-sourcing; let me know if there’s anything you can’t access, or if you need more information.
Docker cmds excerpts 2024-03-20 6-39-09 PM.txt
from bat.
I used your image, tried to have different permissions for less, played around with bat config but the results were the same.
Odd, on my container the bug reproduced when I removed less
, below. Happy to run diagnostics while it’s in this state.
root@kromodeor:/# apt remove less
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
less
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 329 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 42244 files and directories currently installed.)
Removing less (590-1ubuntu0.22.04.2) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
root@kromodeor:/#
root@kromodeor:/#
root@kromodeor:/# batcat /root/.config/bat/config
This is a pretty minimal image, e.g.
root@kromodeor:/# man apt
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, including manpages, you can run the 'unminimize'
command. You will still need to ensure the 'man-db' package is installed.
from bat.
I was checking the code, and bat should fall back to regular non-pager stdout if the pager initiation have any problems. I couldn't find any corner cases.
On the other hand, if the pager itself encounters any problems that is outside of bat's scope. My guess is there is maybe a misconfigured less binary or symlink on your path that outputs nothing for some reason. I created a dummy binary, and the output is piped through it.
root@46test:/# batcat /root/.config/bat/config --pager=lesser
Hello, world!
thread 'main' panicked at src/main.rs:3:5:
There was an issue
from bat.
Interesting, I get the usual silent failure with a nonexistent pager:
root@kromodeor:/# batcat /root/.config/bat/config --pager=SirNotAppearingInThisContainer
root@kromodeor:/# echo $?
0
from bat.
Related Issues (20)
- Bat outputs weird characters HOT 6
- Allow bat to replace variables on text HOT 2
- [Feature request] Add setting to enable maximum column for TSV hyghlighting HOT 2
- possibility to suppress output if stdin is empty and set header manually HOT 5
- Option to omit binary content even when writing to a file
- Syntax request: RDF 🐢 Turtle & SPARQL (*.ttl, *.ttls, etc.)
- compatibility issue with cat while piping in scripts
- Gherkin support
- Add option to ship vendored libgit2 dependency
- Please support .debdiff files HOT 13
- Support for alternative theme file format(s) HOT 2
- Allow --line-range to count from the back of the file to act similar to "tail" HOT 1
- Bat can't find the theme, even though it's present HOT 6
- Should TOML-mapping-implemented file extension globs look like standard supported extensions? HOT 1
- Theme Preview just prints theme name
- Control C exits with return 130 HOT 3
- How to enable Solarized (light) theme HOT 2
- Theme resets on closing / new window HOT 2
- JSON Syntax is not highlighted in JSONC files HOT 1
- bat - Apple Silicon Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bat.