Giter Site home page Giter Site logo

Comments (6)

sharkdp avatar sharkdp commented on May 5, 2024

Thank you for reporting this.

I have never seen this. Could you please provide a little bit more information?

What kind of files does this fail on? Could you provide one of those files for further debugging?

Also, could this be related to rust-lang/rust#44863 ? Could you try to call cargo clean and build bat again?

Also, to make the backtrace more helpful, it would be great if you could build in debug mode (cargo install -f --debug) and run RUST_BACKTRACE=1 bat .. again.

from bat.

sharkdp avatar sharkdp commented on May 5, 2024

Ok, I know what has been causing this - you probably did not install a syntax highlighting theme?

Please follow the instructions here.

The panic should not appear again. I have turned it into a normal error message.

from bat.

kBite avatar kBite commented on May 5, 2024

Syntax highlighting theme is installed.

Can you please provide detailed instructions how clean and install are supposed to be done? I tried

git clone https://github.com/sharkdp/bat.git
cd bat
cargo clean
cargo install -f --debug bat
RUST_BACKTRACE=1 bat README.md 
thread 'main' panicked at 'no entry found for key', libcore/option.rs:917:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::option::expect_failed
             at libcore/option.rs:917
  10: <core::option::Option<T>>::expect
             at /checkout/src/libcore/option.rs:302
  11: <alloc::btree::map::BTreeMap<K, V> as core::ops::index::Index<&'a Q>>::index
             at /checkout/src/liballoc/btree/map.rs:1758
  12: bat::run
             at src/main.rs:175
  13: bat::main
             at src/main.rs:215
  14: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  15: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:479
  16: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  17: std::rt::lang_start_internal
             at libstd/panicking.rs:458
             at libstd/panic.rs:358
             at libstd/rt.rs:58
  18: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  19: main
  20: __libc_start_main
  21: _start

Test file is this repositories' README.md

from bat.

sharkdp avatar sharkdp commented on May 5, 2024

I'm pretty sure this is not the latest version of bat (the line numbers don't match). Could you please make sure to git pull again?

Also, please post the output of

ls -alh ~/.config/bat/themes/Default.tmTheme

It should be a valid Sublime Theme or a symlink to one.

from bat.

kBite avatar kBite commented on May 5, 2024

Latest commit is f43409f

$ ls -alh ~/.config/bat/themes/Default.tmTheme
lrwxrwxrwx 1 kbite kbite 49 Apr 26 18:53 /home/kbite/.config/bat/themes/Default.tmTheme -> sublime-monokai-extended/Monokai Extended.tmTheme

from bat.

sharkdp avatar sharkdp commented on May 5, 2024

Oh, damn - this took me a while to figure out 😄
You are calling cargo install -f bat instead of cargo install -f which installs bat from crates.io (instead of from the current directory). The version on crates.io is outdated, I will update it soon.

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.