Giter Club home page Giter Club logo

Comments (7)

Muresan73 avatar Muresan73 commented on May 28, 2024 1

I would look into this, can you assign it to me please.

from bat.

Muresan73 avatar Muresan73 commented on May 28, 2024 1

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.

Muresan73 avatar Muresan73 commented on May 28, 2024 1

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.

FlashSheridan avatar FlashSheridan commented on May 28, 2024

(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.

FlashSheridan avatar FlashSheridan commented on May 28, 2024

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.

Muresan73 avatar Muresan73 commented on May 28, 2024

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.

FlashSheridan avatar FlashSheridan commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.