mgunyho / tere Goto Github PK
View Code? Open in Web Editor NEWTerminal file explorer
License: European Union Public License 1.2
Terminal file explorer
License: European Union Public License 1.2
I am using tere
inside of an Ubuntu 20.04.4 VM, which I ssh to from a macOS Monterey MacBookPro 2021 M1 Pro host.
My host and VM shell are both zsh
version 5.8.
If I start using tere
from a directory, then navigate to an arbitrary subdirectory using tere
, I can't find a way to actually stay in that directory after exiting tere
. I have tried both Escape
and Ctrl+c
, and unfortunately couldn't figure out a way to use Alt+Q
because my Mac host does not have an Alt
key.
Here's a video demonstrating the problem:
Thanks for this cool tool, but it advertises cd, but there is no clear way to cd. I have tried alt-enter and ctrl-space and these do not change the current directory. Seems like such a simple thing, but the CD part is buried and not discussed or shown in the README or gif at least that I can find.
Oddly the directory is echo'd to the terminal, but the current dir is unchanged. I am guessing the idea is to cd $(tere)
or something like that which is undesirable. That works, but the extra needed typing limits usage. I'll just type cd .config
. I must be missing something here.
As of 1.5.0
, pressing ctrl-c (or whatever triggers ExitWithoutCd
) the
message printed to stderr is
Error: ExitWithoutCd("tere: Exited without changing folder")
while it should be just
tere: Exited without changing folder
this requires clap 3.0.
convenient to find file/folder in gap-anywhere searching mode.
reproduce: type some chars in gap-anywhere mode in a large dir, then pageup/down
Winget
is a package manager provided by Microsoft and bundled in the newer Windows version. Publishing to Winget can make installation in windows more convenient
Save history tree to some file, like ~/.cache/tere/history.json
. Must be configurable by user. Must not affect startup time significantly. Maybe could also try to trim the tree every now and then (with something like last_visited_time
) to keep it from becoming too big.
A weird behaviour not consisting with other cli tools is when I go with tere --version
, the output goes to stderr instead of stdout. Could you please fix this.
Thanks
Something like source "$(tere --init shell)"
similar to how starship does it? This could be nice to declutter one's bashrc(or whatever)? Would require either templating(see zoxide) or a config file though, since one could no longer configure the arguments otherwise... I'd be willing to implement both the printing, and either of the configuration solutions but am I overengineering this?
In Terminal Preview the ?
does not trigger the Help
action, instead it searches.
To work around this use --map Ctrl-h:Help
or any other mapping, I believe a modifier like Ctrl
is needed others it will search.
Or
5 │ function Invoke-Tere() {
6 │ $result = . (Get-Command -CommandType Application tere) --map Ctrl-h:Help $args
7 │
8 │ if ($result) {
9 │ Set-Location $result
10 │ }
11 │ }
12 │ Set-Alias tere Invoke-Tere
There are already some github issues about this. #34 #76
I installed tere
on macOS with brew install tere
. Then I run tere
immediately and it starts, great. However when I Esc'ape tere
, the current dir doesn't get updated, I spend some time on investigating what is wrong.
I had to update my .zshrc
.
Please make tere
do a health-check if it was installed correctly, and guide the user how to fix it.
Also, serialization
Hi!
I have recently downloaded and configured tere on my Linux and I encountered some bug.
When I exit tere with CTRL + C (as suggested in README to exit tere without changing directory)
the mouse cursor position is printed in terminal with every move of my mouse.
To reproduce this:
tere --mouse=on
CTRL + C
Tere! Thank you for tere! :)
Jumping to a bookmarked folder would be a great addition to tere
.
This is extremely useful when there are multiple project dirs or other frequently used locations all over the file system. For example, something is in ~/work/projectA/subproject/src/my/module
, something is in /mnt/long/complicated/network/mount/datasets
, something is in /opt/....
-- you get the idea)
One of these shortcut schemes might work well:
`0
... `9
, `a
... `z
-- vim-style bookmarks (i.e., backtick followed by a single-character bookmark name)Ctrl+1
... Ctrl+9
-- tab-navigation styleAlt+1
... Alt+9
-- since tere uses a lot of alt-shortcuts alreadyIn the vim-style, we lose the ability to search files whose names start with a backtick and bookmark name, but that should be super rare.
The simplest option is to create bookmarks by editing a config file.
Better yet, have one of these shortcuts to assign the current location to a bookmark:
``0
... ``9
, ``a
... ``z
Ctrl+b 1
... Ctrl+b 9
Alt+b 1
... Alt+b 9
This is just a feature suggestion -- feel free to close this issue at any time
Currently, some home-row shortcuts have alt as a modifier, which may be much less convenient than ctrl (e.g. if you have caps lock to ctrl). Would it be possible to also support C-k, C-j, C-g, C-S-g, C-q and some other shortcuts with ctrl modifier as well?
Is it possible to have a configuration option to disable the autoselect when searching & there is only 1 option left.
You could often enter into multiple folders by accident when typing fast.
For example you could be typing the full name of a folder & enter it before you finish typing, making you enter into another folder afterwards as well.
Hello! 🐻
I've been trying to package tere
for Alpine Linux and I created a merge request here: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/49128
As you can see from the failed pipelines, some tests are failing:
failures:
---- app_state::tests::test_case_sensitive_mode_change stdout ----
thread 'app_state::tests::test_case_sensitive_mode_change' panicked at 'assertion failed: `(left == right)`
left: `[2]`,
right: `[1]`', src/app_state.rs:1711:9
failures:
app_state::tests::test_case_sensitive_mode_change
test result: FAILED. 90 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.05s
Also, I get the following failures even though I skip that one test:
failures:
---- panic_guard::tests::test_callback_called_before_panic_hook stdout ----
thread 'panic_guard::tests::test_callback_called_before_panic_hook' panicked at 'assertion failed: `(left == right)`
left: `["cleanup", "hook", "hook", "hook"]`,
right: `["cleanup", "hook"]`', src/panic_guard.rs:135:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- panic_guard::tests::test_callback_called_once_only_panic stdout ----
thread 'panic_guard::tests::test_callback_called_once_only_panic' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/panic_guard.rs:99:36
---- panic_guard::tests::test_nested_callback stdout ----
thread 'panic_guard::tests::test_nested_callback' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/panic_guard.rs:140:36
---- panic_guard::tests::test_nested_callback_hook_restored stdout ----
thread 'panic_guard::tests::test_nested_callback_hook_restored' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/panic_guard.rs:180:36
---- panic_guard::tests::test_nested_callback_with_panic stdout ----
thread 'panic_guard::tests::test_nested_callback_with_panic' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/panic_guard.rs:161:36
failures:
panic_guard::tests::test_callback_called_before_panic_hook
panic_guard::tests::test_callback_called_once_only_panic
panic_guard::tests::test_nested_callback
panic_guard::tests::test_nested_callback_hook_restored
panic_guard::tests::test_nested_callback_with_panic
test result: FAILED. 85 passed; 5 failed; 1 ignored; 0 measured; 1 filtered out; finished in 0.05s
error: test failed, to rerun pass '--bin tere'
I am skipping these tests for now since I am not sure what is happening there.
Weirdly enough, all the tests (including those ones) pass on Arch Linux.
Let me know if I can provide more info to debug this.
Thanks for this great tool! 💯
convenient to do further operation for the current located file/folder
As discussed previously in #29, it seems very useful for the tere
binary itself to provide access to the shell wrappers for tere
that are listed in the README. This can then be used to provide simple one line commands that can be added to shell startup scripts, which has the added benefits of being simpler, easier to change in the future, and more seamless (the correct path to the tere
binary could be automatically filled in).
For example, to setup the tere
shell wrapper for bash and zsh, the following would just need to be added to a startup file (like ~/.bash_profile
):
eval "$(tere init bash)"
This would greatly improve the experience of installing tere
.
If this idea is approved, I would be happy to implement this feature and submit a PR with it implemented.
If a directory's name contains a non-alphanumerical character, tere fails to match past the special character.
For example, given a directory with the following sub-directories: test-dash test.dot test_underscore
, tere finds no directories when the search input is dash
, dot
or underscore
, as shown below:
[root@rpi tere-rs]# cargo install tere
Updating crates.io index
error: failed to download tere v1.1.0
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tere-1.1.0/Cargo.toml
Caused by:
feature strip
is required
The package requires the Cargo feature called strip
, but that feature is not stabilized in this version of Cargo (1.58.0).
Consider trying a newer version of Cargo (this may require the nightly release).
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-strip-option for more information about the status of this feature.
how install strip?
Now tere
can be installed through the window package manager Scoop. Please mention this in Readme.
Currently the window is just blank, which is a bit ugly. Should also check/improve behavior w.r.t enter etc.
I have to use an ancient weird Centos system that has an ancient glibc. It would be nice if you could provide a musl version of this.
I have set up a CLI Rust project before to use the free Github Actions runners to do this and automatically attach the binaries to a Github release. This will let you build it for Mac and Linux too.
Feel free to copy my code - the build.yml
does not build with Musl to keep things simple. The release.yml
does though.
The release attaching thing is a little weird to be honest. Alternatively you can just upload the build artefacts to the CI run and then manually make a release from them.
See here for an example of that.
I'm trying out tere
and I have this simple use-case. For example:
I want to enter the directory c
while viewing the contents of it:
I need to go back (press left arrow key) and press Alt-Enter to cd
into it and exit. Is it possible to cd
to the currently viewed directory via tere
? (Or is there a shell trick that I can use?)
Thank you for your work on this crate. It's very helpfull and I now use it daily!
Just wanted to report than one of the tests is failing.
$ cargo test app_state::tests::test_advance_search_with_filter_search_and_scrolling2
Compiling tere v1.2.0 (/home/frazar/gitprojects/tere)
Finished test [unoptimized + debuginfo] target(s) in 1.47s
Running unittests src/main.rs (target/debug/deps/tere-72c33ccb25bdec8e)
running 1 test
test app_state::tests::test_advance_search_with_filter_search_and_scrolling2 ... FAILED
failures:
---- app_state::tests::test_advance_search_with_filter_search_and_scrolling2 stdout ----
thread 'app_state::tests::test_advance_search_with_filter_search_and_scrolling2' panicked at 'assertion failed: `(left == right)`
left: `0`,
right: `1`', src/app_state.rs:1303:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
app_state::tests::test_advance_search_with_filter_search_and_scrolling2
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 51 filtered out; finished in 0.00s
error: test failed, to rerun pass '--bin tere'
As I anticipated, this is a fairly popular request.
I will need to hash out the syntax. I want it to be obvious (something like --map ctrl+x:ACTIONNAME
to bind ctrlX to something. Something more explicit/easier to understand than the emacs-style C-x
.). Perhaps there already exists one or more crates to parse such options. Suggestions/opinions welcome.
Finished test [unoptimized + debuginfo] target(s) in 0.02s
Running unittests (target/debug/deps/tere-270a1999facff773)
running 30 tests
test app_state::history::tests_for_history_tree::test_from_abs_path ... ok
test app_state::history::tests_for_history_tree::test_change_dir ... ok
test app_state::history::tests_for_history_tree::test_go_to_root ... ok
test app_state::history::tests_for_history_tree::test_history_tree_go_up_down ... ok
test app_state::history::tests_for_history_tree::test_debug_print ... ok
test app_state::history::tests_for_history_tree::test_last_visisted_child ... ok
test app_state::history::tests_for_history_tree::test_tree_pointer_counts ... ok
test app_state::history::tests_for_history_tree::test_history_tree_visit ... ok
test app_state::history::tests_for_history_tree::test_serialize ... ok
test app_state::history::tests_for_history_tree::test_deserialize ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size1 ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size2 ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size3 ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size5 ... ok
test app_state::tests::test_scrolling_bufsize_equal_to_window_size ... ok
test app_state::tests::test_scrolling_bufsize_larger_than_window_size4 ... ok
test ui::help_window::tests::test_strip_markup ... ok
test app_state::tests::test_scrolling_bufsize_less_than_window_size ... ok
test ui::help_window::tests::test_stylize_wrapped_lines ... ok
test app_state::tests::test_advance_search_wrap ... ok
test app_state::tests::test_basic_advance_search ... ok
test app_state::tests::test_advance_search_with_filter_search_and_scrolling ... ok
test app_state::tests::test_advance_and_erase_search_with_filter_and_cursor_on_match2 ... ok
test app_state::tests::test_advance_and_erase_search_with_filter_and_cursor_on_match ... ok
test app_state::tests::test_advance_and_erase_search_with_filter_and_scrolling ... ok
test app_state::tests::test_advance_and_erase_search_with_cursor_on_match ... ok
test app_state::tests::test_advance_and_erase_with_filter_search ... ok
test app_state::tests::test_advance_and_clear_with_filter_search ... ok
test app_state::tests::test_advance_search_with_filter_search_and_scrolling2 ... FAILED
test ui::help_window::tests::test_user_guide_found ... ok
failures:
---- app_state::tests::test_advance_search_with_filter_search_and_scrolling2 stdout ----
thread 'app_state::tests::test_advance_search_with_filter_search_and_scrolling2' panicked at 'assertion failed: `(left == right)`
left: `0`,
right: `1`', src/app_state.rs:1302:9
stack backtrace:
0: 0x562fb242f11c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf9a1e5015c7372de
1: 0x562fb246414e - core::fmt::write::h9fe85dc123605e26
2: 0x562fb2435db8 - std::io::Write::write_fmt::h669a8e5c6721b05b
3: 0x562fb2446446 - std::panicking::default_hook::{{closure}}::h5be0c3f8bc5f82d3
4: 0x562fb244611b - std::panicking::default_hook::h26c625e8da3d12e5
5: 0x562fb2446a89 - std::panicking::rust_panic_with_hook::h9e5373efea59497b
6: 0x562fb2430077 - std::panicking::begin_panic_handler::{{closure}}::h6675d1d897d2268b
7: 0x562fb242f244 - std::sys_common::backtrace::__rust_end_short_backtrace::h2eebb466dcccf8e7
8: 0x562fb2446582 - rust_begin_unwind
9: 0x562fb21acb13 - core::panicking::panic_fmt::h388cf0442c96c658
10: 0x562fb2463e28 - core::panicking::assert_failed_inner::hd0043323e1ada698
11: 0x562fb23a249a - core::panicking::assert_failed::h90a5c29b4fafe7d0
at /build/rustc-1.60.0-src/library/core/src/panicking.rs:182:5
12: 0x562fb21de589 - tere::app_state::tests::test_advance_search_with_filter_search_and_scrolling2::habde54d36d24058d
at /home/matt/tere/src/app_state.rs:1302:9
13: 0x562fb21b2ffa - tere::app_state::tests::test_advance_search_with_filter_search_and_scrolling2::{{closure}}::hf403113eab43dc25
at /home/matt/tere/src/app_state.rs:1277:5
14: 0x562fb21cdebe - core::ops::function::FnOnce::call_once::h1c97ee7d170ed169
at /build/rustc-1.60.0-src/library/core/src/ops/function.rs:227:5
15: 0x562fb2211db3 - test::__rust_begin_short_backtrace::h626545a4b88d88d6
16: 0x562fb2211f39 - test::run_test_in_process::h41943d41ab2a9a0f
17: 0x562fb223e518 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd93c8f36d9bfcd36
18: 0x562fb2224866 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7f08ed4d6f63ce2a
19: 0x562fb2443793 - std::sys::unix::thread::Thread::new::thread_start::h17b4aae352c54ef4
20: 0x7f28368caff2 - start_thread
21: 0x7f283694dbfc - clone3
22: 0x0 - <unknown>
failures:
app_state::tests::test_advance_search_with_filter_search_and_scrolling2
test result: FAILED. 29 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
error: test failed, to rerun pass '--bin tere'
Encountered first on NixOS, then tested in an Ubuntu docker container.
Hello everyone!
It will be great if tool such this will have a hotkey which will spawn terminal in location was browsed via it.
If I will got some free time - will PR that func soon.
Thx a lot.
> cargo build
Compiling tere v1.2.0 (/home/frazar/gitprojects/tere)
warning: unnecessary parentheses around match arm expression
--> src/ui/help_window.rs:190:23
|
190 | (_, _) => (c1.to_string().cmp(&c2.to_string())),
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
190 - (_, _) => (c1.to_string().cmp(&c2.to_string())),
190 + (_, _) => c1.to_string().cmp(&c2.to_string()),
|
warning: `tere` (bin "tere") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 1.42s
e.g. ctrl-F
to go into a mode where matches can be anywhere in a folder name, not just the beginning
This would be made much easier to install if a Debian package was available to install with apt.
Add a new Keyboard shortcut to hide hidden files/directories.
Integration tests were added in the last release, more specifically: 70d2686
I'm getting the following test failures in a clean chroot build:
running 4 tests
test basic_run ... FAILED
test first_run_prompt_accept ... FAILED
test output_on_exit_without_cd ... FAILED
test first_run_prompt_cancel ... FAILED
failures:
---- basic_run stdout ----
thread 'basic_run' panicked at 'assertion failed: `(left == right)`
left: `"Error: Io(Os { code: 11, kind: WouldBlock, message: \"Resource temporarily unavailable\" })\r\n"`,
right: `"/tmp/.tmpmJWT4L\r\n"`', tests/cli.rs:61:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- first_run_prompt_accept stdout ----
thread 'first_run_prompt_accept' panicked at 'assertion failed: ptn.find(&output).is_some()', tests/cli.rs:126:5
---- output_on_exit_without_cd stdout ----
thread 'output_on_exit_without_cd' panicked at 'assertion failed: `(left == right)`
left: `"Error: Io(Os { code: 11, kind: WouldBlock, message: \"Resource temporarily unavailable\" })\r\n"`,
right: `"tere: Exited without changing folder\r\n"`', tests/cli.rs:76:5
---- first_run_prompt_cancel stdout ----
thread 'first_run_prompt_cancel' panicked at 'assertion failed: ptn.find(&output).is_some()', tests/cli.rs:96:5
failures:
basic_run
first_run_prompt_accept
first_run_prompt_cancel
output_on_exit_without_cd
test result: FAILED. 0 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
error: test failed, to rerun pass `--test cli`
I couldn't figure out why this is happening so I thought it'd better to report here.
As a workaround, I tried skipping the integration tests and using --lib
but got error: no library targets found in package tere
.
I tried -no-gap-search switch, but it searches from start
Hacktoberfest is an interesting and low-hassle way to attract contributors. More info here.
To do so, it should be sufficient to add the hacktoberfest label to the GitHub repository.
It would be nice to test/fmt/clippy tere
via GitHub Actions on each push. I would like to provide a PR if applicable.
convenient to filter out unrelavent files/folders in the gap-anywhere search mode, if some highlights are far more pages away
Since tere
is used to browse the filesystem fast and not to open files, searching for files is not very useful (we can't chdir into a file :) ). There is already an option --folders-only
, but it disables not only search through files but there display as well. Having files displayed makes sense as for me: for example, you don't need to run ls
after exiting from tere
to see what's inside the folder.
Having a special mode where files are displayed but not searched would give the best of two existing options: both seeing everything immediately and rapid browsing the filesystem without files being treated as potential chdir targets.
Trying tere on ubuntu bionic I obtained
./tere: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found (required by ./tere)
./tere: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./tere)
and
ls -l /lib/x86_64-linux-gnu/libc.so.6
lrwxrwxrwx 1 root root 12 mag 3 12:19 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.27.so*
Currently the listing is always sorted by name. Would be nice to also sort by e.g. date, although I have not had much use for this. In that case, should also add a date column to the listing. Should be configurable whether the sorting stays the same when entering a folder.
I think it would be useful to allow file selection, too. E.g., with less $(env tere)
one could read a selected file. I guess it makes sense to define a special shortcut for file selection, like Alt-w
instead of Alt-q
. Using Enter
would also work, though if the caller passes a special argument when invoking tere
, like --allow-files
.
Is there a way to navigate to a different drive on windows?
On startup, show a message like Type '?' for help
in the info bar.
Automatically show each keyboard shortcut?
This is how for example ranger --choosedir
works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.