Closed greembow closed 2 years ago
@greembow Hey, thanks for filing an issue! By default, ctrlg
searches ~/git/
, if you want to search a different directory, or set of directories, you'll need to specify in the config file at ~/.config/ctrlg/config.yml
. Could that be your issue?
I should probably make this a little bit more clear in the README.md. There's also an issue right now where it will only check for config.yml
and not config.yaml
in the ~/.config/ctrlg/
directory. I can get that issue fixed pretty quickly.
@mrjones2014 Thanks! I'm very stupid then haha. I tried following your instructions and I'm now getting a panic upon opening ctrlg.
greembow in ~ % > thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: invalid type: sequence, expected a boolean for key `preview_fallback_exa` in .config/ctrlg/config.yml', /home/greembow/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlg-0.1.0/src/settings.rs:89:76
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
greembow in ~ % > export RUST_BACKTRACE=1
greembow in ~ % > thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: invalid type: sequence, expected a boolean for key `preview_fallback_exa` in .config/ctrlg/config.yml', /home/greembow/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlg-0.1.0/src/settings.rs:89:76
stack backtrace:
0: rust_begin_unwind
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:495:5
1: core::panicking::panic_fmt
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/core/src/panicking.rs:107:14
2: core::result::unwrap_failed
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/core/src/result.rs:1617:5
3: std::sync::once::Once::call_once::{{closure}}
4: std::sync::once::Once::call_inner
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/sync/once.rs:419:21
5: ctrlg::settings::Settings::merge_find_args
6: ctrlg::commands::CtrlgCommand::run
7: ctrlg::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
greembow in ~ % > export RUST_BACKTRACE=full
greembow in ~ % > thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: invalid type: sequence, expected a boolean for key `preview_fallback_exa` in .config/ctrlg/config.yml', /home/greembow/.cargo/registry/src/github.com-1ecc6299db9ec823/ctrlg-0.1.0/src/settings.rs:89:76
stack backtrace:
0: 0x55eabcdd322c - std::backtrace_rs::backtrace::libunwind::trace::hc6c3491277866fea
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x55eabcdd322c - std::backtrace_rs::backtrace::trace_unsynchronized::h4524f073368a5b13
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x55eabcdd322c - std::sys_common::backtrace::_print_fmt::h0d0cace6159902af
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/sys_common/backtrace.rs:67:5
3: 0x55eabcdd322c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3e6af6f05919a7fc
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/sys_common/backtrace.rs:46:22
4: 0x55eabcdf879c - core::fmt::write::h72801a82c94e6ff1
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/core/src/fmt/mod.rs:1163:17
5: 0x55eabcdce4e5 - std::io::Write::write_fmt::ha4f5d34aaccbac84
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/io/mod.rs:1696:15
6: 0x55eabcdd4cd0 - std::sys_common::backtrace::_print::heed69f5ce9a8e189
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/sys_common/backtrace.rs:49:5
7: 0x55eabcdd4cd0 - std::sys_common::backtrace::print::h5f3918bd80c09252
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/sys_common/backtrace.rs:36:9
8: 0x55eabcdd4cd0 - std::panicking::default_hook::{{closure}}::h5af30648530eb3d0
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:210:50
9: 0x55eabcdd487b - std::panicking::default_hook::he88d5fb1ba1b4c19
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:227:9
10: 0x55eabcdd5384 - std::panicking::rust_panic_with_hook::h01febc308b2b313b
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:602:17
11: 0x55eabcdd4e60 - std::panicking::begin_panic_handler::{{closure}}::h24a6d13f5560b71f
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:499:13
12: 0x55eabcdd36d4 - std::sys_common::backtrace::__rust_end_short_backtrace::h3e2917f0da9fbc5c
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/sys_common/backtrace.rs:139:18
13: 0x55eabcdd4dc9 - rust_begin_unwind
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:495:5
14: 0x55eabcb98561 - core::panicking::panic_fmt::h7b8580d81fcbbacd
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/core/src/panicking.rs:107:14
15: 0x55eabcb98653 - core::result::unwrap_failed::h885d3f7beb571353
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/core/src/result.rs:1617:5
16: 0x55eabcba2e5f - std::sync::once::Once::call_once::{{closure}}::hd04e9a03b3296881
17: 0x55eabcb975fe - std::sync::once::Once::call_inner::h911bb651f19e1e50
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/sync/once.rs:419:21
18: 0x55eabcb9c4f3 - ctrlg::settings::Settings::merge_find_args::h0664ed532e72bdd4
19: 0x55eabcba81e4 - ctrlg::commands::CtrlgCommand::run::h0ba0b9b7aa3cb6ef
20: 0x55eabcba29b7 - ctrlg::main::h40b85dff1308e2ff
21: 0x55eabcb9e3a3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hb2eb6c6d024fcf17
22: 0x55eabcba2b19 - std::rt::lang_start::{{closure}}::h02c7a39f50ba527e
23: 0x55eabcdd2ac1 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h6743157f0325d450
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/core/src/ops/function.rs:259:13
24: 0x55eabcdd2ac1 - std::panicking::try::do_call::hc65378359d322d46
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:403:40
25: 0x55eabcdd2ac1 - std::panicking::try::h52b83ca0140efb28
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:367:19
26: 0x55eabcdd2ac1 - std::panic::catch_unwind::h0ba25f4b0d3448dc
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panic.rs:133:14
27: 0x55eabcdd2ac1 - std::rt::lang_start_internal::{{closure}}::ha65f28100c5ad390
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/rt.rs:128:48
28: 0x55eabcdd2ac1 - std::panicking::try::do_call::h5db5edfaf5b749d9
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:403:40
29: 0x55eabcdd2ac1 - std::panicking::try::h62409771d6cd0419
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panicking.rs:367:19
30: 0x55eabcdd2ac1 - std::panic::catch_unwind::h386261fb8f018fab
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/panic.rs:133:14
31: 0x55eabcdd2ac1 - std::rt::lang_start_internal::h699f3530566c1833
at /rustc/00d5e42e776da900049fe19087bc9b0057ec70cd/library/std/src/rt.rs:128:20
32: 0x55eabcba2a22 - main
33: 0x7f2df9df7b25 - __libc_start_main
34: 0x55eabcb98cfe - _start
35: 0x0 - <unknown>
If it matters. I get an exitcode of 130.
Config file:
# configure what directories to list in the fuzzy finder
# can be any list of globbing patterns, will only show directories
# not files
search_dirs:
- "~/Documents/Programming/*"
# globbing patterns of files to find for use as preview
# see below for more details on previews
preview_files:
- "README.*"
# enable or disable the preview window
previews: true
# force using or not using `bat` for previews
preview_with_bat: [true if `bat` is installed, false otherwise]
# force using or not using `exa` for preview fallback when no
# matching `preview_files` are found
preview_fallback_exa: [true if `exa` is installed, false otherwise]
This is because it's expecting preview_with_bat
and preview_fallback_exa
to be boolean values (or not exist). The [true if exa is installed, false otherwise]
is just meant to represent the fact that if exa
is installed, it will be used by default.
Though you do bring up a good issue -- the documentation surrounding this needs to be improved.
Also as a note, previews
is true
by default, and preview_files
is - "README.*"
by default -- search_dirs
is the only one you have there that isn't the default value, so you can exclude the other values unless you want to customize them.
I could also make it so that there's some sort of message printed if no directories are found.
Oh lord. I can't believe that after working with YAML for 3+ years that I didn't notice that. facepalm It's working great now! Awesome tool and I can't wait for more features if that ends up happening!
I could also make it so that there's some sort of message printed if no directories are found.
I think that would be a good solution.
I'll make a PR for this issue to print that error.
I can't wait for more features if that ends up happening!
Feel free to file a feature request if you have ideas :)
This will be released as 0.1.1 as soon as this job succeeds: https://github.com/mrjones2014/ctrlg/actions/runs/1607959122
whoops forgot to bump the version 😅 I've published it manually.
Similar Issues
Description
I'm not sure if the GIF will load properly, but basically, when I press ctrl-g, the ctrlg UI appears, but nothing ever happens after that. Maybe I'm using it wrong?
Operating System + Version
Arch Linux 5.15.7-arch1-1
Shell + Version
zsh 5.8 (x86_64-pc-linux-gnu)
Minimal Configuration to Reproduce
I'm sorry that this is probably the worst .zshrc you've ever seen. :(
Additional Details
Lenovo ThinkPad X1 Yoga 4th Intel i7 10510U 16gb DDR4 Intel Integrated Graphics