Giter Site home page Giter Site logo

hunter's Introduction

hunter

hunter

NEW

  • [FASTER] hunter is now much faster
  • [Custom Keybindings] Customize keys to your liking
  • [Graphics] High quality support for graphics using SIXEL/kitty protocols
  • [QuickActions] Added quick action creator/customizer
  • [Previews] New and improved preview customization
  • [IRC channel] Problems? Bugs? Praise? Chat with us: #hunter @ Freenode!

hunter is a fast and lag-free file browser/manager for the terminal. It features a heavily asynchronous and multi-threaded design and all disk IO happens off the main thread in a non-blocking fashion, so that hunter will always stay responsive, even under heavy load on a slow spinning rust disk, even with all the previews enabled.

It's heavily inspired by the excellent ranger, but a little more Emacs-flavoured, and written in Rust to make sure it starts up quickly and to take advantage of its strong guarantees around concurrency. It's so fast I actually built in animations for some parts as a joke, but in fact it turned out to look really nice and makes it look much smoother. YMMV, of course, and this can be disabled.

Most things you would expect are implemented, among them tabs, bookmarks (with ranger-import), search/filter, previews of files/directories (including size information in previewed directories), a minibuffer at the bottom with file name completion, multi file selection, etc., etc. There are also a few original ideas, especially around subprocess handling. The process viewer actually shows the output of started subprocesses, their pids and exit codes, notifies on new output and process completion. It's somewhat of a primitive TUI shell. File names are handled using raw OsString, so there is no file it can't handle, no matter what garbage the name contains. It also sets the tmux/terminal title to the current directory on supported terminals.

To speed up the loading of directories metadata in the preview/backview is only loaded for files you can see, except in the main view. Still, metadata is also loaded asynchronously, so you can sometimes see it updating file listings while browsing through your files. I think this is better than waiting though :).

Technically hunter is not a file "manager" itself. It has no built in primitives for file manipulation like delete, rename, move, and so on. Instead it relies on its easy and extensive integration with the standard cli tools to do its job. For that purpose there are various file name/path substitution patterns and an auto-completing for executables you want to run.

It also features a "quick action" mode in which you can execute customizable actions based on the file's MIME type. These can be shell-scripts or other executables. It's possible to to make hunter ask for input before these are run. The input will be put in an environment variable for the process to use. For example, you can select a few files, run a "create archive" action and you will be asked for a name for the resulting archive. You can find a more detailed explanation below.

This is a young project and probably (definitely) has some bugs and edge cases. It hasn't been tested on a lot of terminals, but at least alacritty, kitty and urxvt work fine. It should work on most Unix-flavoured systems supported by Rust, but was only tested on GNU/Linux. I haven't lost any files so far, at least.

A big thanks to ranger and its developers. Without its inspiration this wouldn't have been possible. hunter is not a drop-in replacement and doesn't cover every use-care, especially if you're into advanced customization, since hunter has basically none unless you modify the code, but if you just need fast above all else it might be a good choice.

Features:

  • Lag-free architecture, always responsive
  • Asynchronous multi-threaded IO
  • Tabs
  • Multi-file selection
  • Customizable Quick Actions based on file type
  • Enter directories/select files using external command like fzf
  • ranger import for bookmarks/tags
  • Minibuffer with completion and filename/selection/tab/directory substitution
  • Subprocess viewer that shows output of started subprocesses
  • Exit and cd into last directory and put selected files into shell variables
  • Slide up animation for previews for a smoother experience (configurable)
  • Can show icons with the right fonts
  • Optional support for previews of image(+pdf)/video/audio files using Unicode half-block drawing and SIXEL, or kitty's graphics protocol

Known to work on:

  • GNU/Linux
  • macOS
  • Windows (WSL)

If it works on a system not mentioned here, please open an issue. Also feel free to open an issue if it doesn't work on your system, if it's reasonably Unix-like.

PREREQUISITES:

  • gcc
  • Rust-nighly compiler
  • GStreamer for video/audio previews (optional)
  • libsixel (optional)

PREVIEWERS

hunter comes with definitions to enable previewing certain file types. To use this you need to install some programs first. You can also define your own. See below. Defaults are:

  • bat / highlight for syntax highlighting
  • bsdtar / 7z / atool for archives
  • w3m / links / elinks / lynx for html
  • pdftotext / mutool for pdf or pdftoppm in graphics mode

Debian/Ubuntu

  • apt install gcc libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good libgstreamer-plugins-bad1.0-dev libsixel-bin

INSTALLATION:

Compiling hunter currently requires a nightly Rust compiler! The easiest way to get a nightly compiler is with rustup. If you have rustup installed it will automatically download and use a version that is known to work when you run cargo.

By default it will install a full-featured version with support for media-previews. You can control this using the feature flags img, video and sixel. These can be disabled by calling cargo with --no-default-features. You can then enable image previews with --features=img and add video/audio with --feature=img,video. Note that video requires img!

Note that media previews only work if hunter can find the "hunter-media" tool somewhere in $PATH!

Install rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Build with cargo

cargo install (--no-default-features --features=...) hunter

Build from source

// Clone the git repo
git clone https://github.com/rabite0/hunter.git

// Go into the repos directory
cd {source_dir}/hunter/

// (Optional) Build
// cargo build --release (--no-default-features --features=...)

// Install
cargo install (--no-default-features --features=...) --path .

Packaging status

Fedora Copr: sudo dnf copr enable atim/hunter -y && sudo dnf install hunter

Configuration

hunter reads $XDG_CONFIG_HOME/hunter/config at startup. On macOS it simply reads ~/.config/hunter/config. There are a few options which can be set. The configuration file is read asynchronously, so if it's not read by the time hunter starts drawing you will see its default configuration until the config file is read. Options can be set like this (default config):

animation=on
show_hidden=off
select_cmd=find -type f | fzf -m
cd_cmd=find -type d | fzf
icons=off
ratios=20,30,49
animation_refresh_frequency=60
media_autostart=off
media_mute=off
media_previewer=hunter-media
graphics_mode=auto (other choices: kitty/sixel/unicode)

Keys

Keys can be configured in ~/.config/hunter/keys. Some actions can be further customized with arguments. For example, you can specify a hard-coded Up(n), where n is a positive number to move up n times. This could look like Up(10)=K``` to move up 10 times at once.

Some keys like F1-F12 are represented as an enum like this: F(n). You can take that number n and stick it into the GotoTab(n) action by using a placeholder binding like this: GotoTab(_)=F_. That way, all F(n) keys will be bound to move to the tab number extracted from the F(n) keys.

This also works for key combinations, so you can specify C-_ to bind all Ctrl- combinations to some action like Delete(_) on bookmarks. To bind _ itself escape it like this: \_. See the default configuration for more examples.

NOTE

hunter parses both M- and A- as Alt, so you can use whichever you like best. By default it uses M-, because it came naturally and I think A- looks weird ;).

Previews

Defining previews is easy. You just need a shell script that takes a path as first parameter and prints out what you want to see in the preview column. Put that shell script in

$HOME/.config/hunter/previewers/definitions

and create a symlink to it in

$HOME/.config/hunter/previewers/

with the extension of the file type you want to preview. Make sure the script is executable. That's it.

A graphical previewer can be created by appending .g to the name of the symlink. It should print the path to the generated image file. If you want the file deleted after display, create it in the /tmp/hunter-preview directory.

Quick Actions

These are executables you can run by pressing a. Which actions you can see depends on the MIME type of the files you have selected. If you have multiple files selected, hunter will try to use the most specific MIME type possible. For example, if you have selected a bunch of images with different types you will see actions for "image/". You can see the computed MIME type in the header bar.

There are "universal", "base-type", and "sub-type" actions. These are stored in

~/.config/hunter/actions/<base-type>/<sub-type>/

Universal actions are always available. These are stored right in the "actions" directory. "Base-type" actions are stored in directories like "text", "image", "video". These correspond to the part left of the "/" in a full MIME-type like "image/png". These will be available to all "text", "image", or "video" files. This list is not exhaustive, there are a lot more base-types. In addition to that you can create a directory in those base-type directories to store "sub-type" actions, which are only available to a specific file type..

For example, if you want to define an action only available to PNG images, you can store that in

~/.config/hunter/actions/image/png/custom_pngcrush.sh

You can also ask for input before those actions are run. This input will be entered through hunter's minibuffer. To ask for input append "?question" to the file name, but before the extension. hunter will then set an environment variable named after whatever you put after the question mark. You can also ask for multiple things to be entered.

For example, you could name an action

download_stuff?url?destination.sh

hunter will ask for the "url" and the "destination" before running your script. The values will be available through the $url and $destination environment variables.

You can also make the action run in the foreground, so that it will take over the terminal while it runs. To do that simply append "!" to the file name before the extension. It should look like this:

action?query1?query2!.sh

This will ask two questions and then run the script in the foreground until it quits.

There are a few examples in extras/actions. You can copy the whole directory into ~/.config/hunter/ and try it out.

Startup options

You can set a few options when hunter starts. These override the configuration file. You can also tell hunter to start in a certain directory.

USAGE: hunter [FLAGS] [path]

FLAGS
-a, --animation-off Turn off animations
--help Prints help information
-i, --icons Show icons for different file types
-h, --show-hidden Show hidden files
-u, --update-config Updates previewers/actions
-V, --version Prints version information

WARNING

If you made any changes to the built-in previewers/actions, those changes will be lost when using -u. In that case it's better to just delete the previewer/action you want to update. On the next start hunter will reinstall the missing files automatically.

Drop into hunter cwd on quit

To change the directory of your shell when quitting hunter with Q you need to source extra/hunter_cd.sh, which is a wrapper that runs hunter and checks for ~/.hunter_cwd after hunter exits and cd's into the contained directory if it exists.

Filename Substitution

Pattern Substituted with
$s selected file(s)
$n tab directory
$ns selected files in tab

Keybindings:

Note: _ means any key.

Movement:

Action Key
Up(1) k, Up
Down(1) j, Down
Left b, Left
Right f, Right
Top <, Home
Bottom >, End
Up(10) K
Down(10) J
PageUp C-v, PageUp
PageDown M-v, PageDown

File Browser (global effects):

Action Key
Quit q
QuitWithDir Q
LeftColumnDown ]
LeftColumnUp [
GotoHome ~
TurboCd /
SelectExternal M-Space
EnterDirExternal M-/
RunInBackground F
GotoPrevCwd -
ShowBookmarks `
AddBookmark b
ShowProcesses w
ShowLog g
ShowQuickActions a
RunSubshell z
ToggleColumns c
ExecCmd !

File List (affects current directory):

Action Key
Search C-s
SearchNext M-s
SearchPrev M-S
Filter C-f
Select Space
InvertSelection v
ClearSelection V
FilterSelection M-V
ToggleTag t
ToggleHidden h
ReverseSort r
CycleSort s
ToNextMtime K
ToPrevMtime k
ToggleDirsFirst d

Tabs

Action Key
NewTab C-t
CloseTab C-w
NextTab Tab
PrevTab BackTab
GotoTab(_) F_

Media

Action Key
TogglePause M-m
ToggleMute M-M
SeekForward M->
SeekBackward M-<

Bookmarks

Action Key
GotoLastCwd `
Goto(_) _
Delete(_) M-_

Processes

Action Key
Close w, Esc
Remove d
Kill k
FollowOutput f
ScrollOutputUp C-p
ScrollOutputDown C-n
ScrollOutputPageUp C-V
ScrollOutputPageDown C-v
ScrollOutputTop C-<
ScrollOutputBottom >

MiniBuffer

Action Key
InsertChar(_) _
InsertTab(_) F_
Cancel C-c, Esc
Finish Enter
Complete Tab
DeleteChar C-d, Delete
BackwardDeleteChar Backspace
CursorLeft C-b, Left
CursorRight C-f, Right
HistoryUp C-p, M-p, Up
HistoryDown C-n, M-n, Down
ClearLine C-u
DeleteWord C-h
CursorToStart C-a, Home
CursorToEnd C-e, End

Folds

Action Key
ToggleFold t, Tab

Log

Action Key
Close g, Esc

QuickActions

Action Key
Close a, Esc, C-a
SelectOrRun(_) _

hunter's People

Contributors

0xflotus avatar alexherbo2 avatar ath3 avatar cpdean avatar mfornet avatar petrusboniatus avatar prsprsbk avatar rabite0 avatar snpefk avatar steveslatky avatar straussdd avatar tim77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hunter's Issues

[Perf] Laggy when scrolling quickly through a list

If you scroll fast (e.g. continually depress the down-arrow to move the cursor down a list), input becomes "laggy" and doesn't stop as soon as input stops.

Expected: cursor should stop immediately when the key is released

Actual: when you release the key the cursor continues for a few extra lines. The longer the key was held, the further "extra distance" the cursor goes, thus giving it an "inertial" effect.

Add batch_cmd option

How about adding a batch_cmd option to batch rename / delete – and more generally, for batch processing – a set of selections?

Example – Batch processing with Batch:

~/.config/hunter/config

batch_cmd=batch

Hunter output breaks if the terminal is too wide.

Hunter output breaks if the terminal is too wide. It seems to happen when there are more than 197 columns in the terminal.

It only show a line on the first row and on the bottom row.

It happens both in gnome-terminal and alacritty.

# Terminal width
$ tput cols
197

Compilation error: missing feature uniform_paths

Compiling the version 1.0.1 in Manjaro I got 5 compiling errors like this:

error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
  --> src/main.rs:62:5
   |
41 | mod tabview;
   | ------------ not an extern crate passed with `--extern`
...
62 | use tabview::TabView;
   |     ^^^^^^^
   |
   = help: add #![feature(uniform_paths)] to the crate attributes to enable

Command used: cargo build --release
Workaround: adding #![feature(uniform_paths)] at the start of main.rs makes the project compile.

(FEATURE REQUEST)Devicons Built-In

Would be really cool if Hunter had devicons built in. Here is an example of what I mean, [https://github.com/alexanderjeurissen/ranger_devicons](Ranger Devicons) .

Mouse events causes weird behavior

When I move the mouse over the terminal window and touch scroll, or click mouse buttons, program start behaving strangely.
image

  1. 3 weird blue vertical bars are rendered between main panels. On each event, bar grows!
  2. On left bar some random symbols appears, U,D,),
  3. Above the right bar, several \ are rendered

Also, annoying event shows up on the bottom, that says me to not use the mouse, but this I could ignore.

I'd suggest just disable terminal mouse events, so users could use mouse for simply selecting the text, to be copied elsewhere.

Incremental search

While searching using S it is useful to have incremental search to see partial match and correct search faster. Similar to incsearch in vim.

Check rust compiler version

A lot of people had problems compiling hunter, because they weren't using a recent enough nightly compiler.

Solution:
A check in build.rs and bail with a warning when they're not on rust-nightly.

README

PREVIEWERS

hunter comes with definitions to enable previewing certain file typse. To use this you need to install some programs first. You can also define your own. See below. Defaults are:

bat / highlight for syntax highlighting
7z for archives
w3m / links / elinks / lynx for html
pdftotext / mutool for pdf

Debian/Ubuntu

**apt install gcc libmagic-dev gstreamer1.0-devel gst-plugins-base gst-plugins-good**

Fix typo: typse ==> types

The installation dependencies are not for Debian/Ubuntu.

This works for me (Ubuntu 18.04):

apt-get gcc libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good

libmagic.so is provided by libmagic1 package, but I have the feeling it is not required anymore by hunter as tree_magic is now used instead of mime_detective.

#![feature] may not be used on the stable release channel

Hey,

Thank for the project! You are doing well. :)

On compiling phase via AUR on Arch Linux, I am getting this:

error[E0554]: #![feature] may not be used on the stable release channel
 --> /home/dentrax/.cargo/registry/src/github.com-1ecc6299db9ec823/hunter-1.1.0/src/main.rs:1:1
  |
1 | #![feature(vec_remove_item)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> /home/dentrax/.cargo/registry/src/github.com-1ecc6299db9ec823/hunter-1.1.0/src/main.rs:2:1
  |
2 | #![feature(trivial_bounds)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> /home/dentrax/.cargo/registry/src/github.com-1ecc6299db9ec823/hunter-1.1.0/src/main.rs:3:1
  |
3 | #![feature(try_trait)]
  | ^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> /home/dentrax/.cargo/registry/src/github.com-1ecc6299db9ec823/hunter-1.1.0/src/main.rs:4:1
  |
4 | #![feature(fnbox)]
  | ^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0554`.
error: failed to compile `hunter v1.1.0`, intermediate artifacts can be found at `/tmp/cargo-installTlPHje`

Similar to: #15

But, I am new to Rust; So, I don't exactly understand the Rust specific terms. How could we solve the this bug (with box-of-the-box way)?

cargo: cargo 1.34.0
rustc: rustc 1.34.0

Thanks!

panicking with AsyncError("Not ready yet!")

I can get the program to crash on my machine doing the following:

1/ go to my home folder (either from within hunter, or start hunter from ~)
2/ press 's'

I get the following stack trace.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: AsyncError("Not ready yet!")', src/libcore/result.rs:997:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   6: rust_begin_unwind
             at src/libstd/panicking.rs:312
   7: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   8: core::result::unwrap_failed
   9: alloc::slice::<impl [T]>::sort_by::{{closure}}
  10: alloc::slice::merge_sort
  11: hunter::files::Files::sort
  12: <hunter::listview::ListView<hunter::files::Files> as hunter::listview::Listable>::on_key
  13: <hunter::file_browser::FileBrowser as hunter::widget::Widget>::on_key
  14: hunter::widget::Widget::handle_input
  15: hunter::main
  16: std::rt::lang_start::{{closure}}
  17: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:297
  18: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:92
  19: std::rt::lang_start_internal
             at src/libstd/panicking.rs:276
             at src/libstd/panic.rs:388
             at src/libstd/rt.rs:48
  20: main
  21: __libc_start_main
  22: _start

sorting by size in other folders works for me though

How to exit Hunter?

I pressed something (wanted to type ls, forgot htat hunter is open)
and now it shows it's log and I can't exit
image

Quoted list values

Use the same approach than Kakoune.

Example – Print selected files:

eval "set -- $s"

# Using a for-loop
for file do
  echo "$file"
done

# Using printf
printf '%s\n' "$@"

Will Not Compile(gstreamer error)

Using the latest version of Rustup and a freshly installed Pop! OS I keep running into an error every single time I run
cargo install hunter
the error I get is

https://pastebin.com/t2W0Hd3s

I already double checked and all my gstreamer things were installed correctly. Not sure why I am getting this error. Oh and your preinstalls for Ubuntu/Debian give me this error

Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package gstreamer1.0-devel E: Couldn't find any package by glob 'gstreamer1.0-devel' E: Couldn't find any package by regex 'gstreamer1.0-devel' E: Unable to locate package gst-plugins-base E: Unable to locate package gst-plugins-good

Terminal left in bad state after running hunter

OS: Arch Linux
Terminal: Alacritty 0.2.9
Hunter Version: 1.0.1 (evil branch) (also happens in master branch)

Steps to Reproduce

  1. Run hunter
  2. Quit hunter q

Expected Results

After exiting the terminal is restored to its previous state.

Actual Results

After exiting it's no longer possible to scroll or click in the Alacritty window. Doing so outputs what appears to be raw escape sequences that look like this:

65;52;47M65;52;46M65;52;46M65;52;46M65;52;46M64;52;46M64;52;46M64;52;46M0;52;46M0;52;46m0;52;46m0;52;46m0;33;64M32;34;64M32;34;65M32;35;65M0;35;65m

Compilation error: #![feature] may not be used on the stable release channel

I'm trying to compile hunter in evil mode - release 1.0.2 and I'm getting this error:

error[E0554]: #![feature] may not be used on the stable release channel
 --> src/main.rs:1:1
  |
1 | #![feature(vec_remove_item)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> src/main.rs:2:1
  |
2 | #![feature(trivial_bounds)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> src/main.rs:3:1
  |
3 | #![feature(try_trait)]
  | ^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> src/main.rs:4:1
  |
4 | #![feature(fnbox)]
  | ^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0554`.

I understand why this error occurs and how I might be able to fix - by using the nightly version of rustc but I was wondering whether you have any plans in not using non-stable features of rustc such as this. I'm using Arch Linux and rust version 1.33.0.

Cross-platfrom file watching support

On macOS, compilation currently fails with the following error message:

  Compiling hunter v1.0.1 (/Users/mendler/Code/upstream/hunter)
error[E0432]: unresolved import `notify::INotifyWatcher`
 --> src/fscache.rs:1:14
  |
1 | use notify::{INotifyWatcher, Watcher, DebouncedEvent, RecursiveMode};
  |              ^^^^^^^^^^^^^^ no `INotifyWatcher` in the root

That's because inotifywatch is Linux-specific.
I recommend https://github.com/passcod/notify for cross-platform filesystem notifications.

How to select a file or change a directory using fuzzy finders?

What is the equivalent to the following lf commands, which use fzf and fd?

Example – Select a file:

cmd select-fuzzy ${{
  lf -remote "send $id select $(fd --type file | fzf)"
}}

map s select-fuzzy

Example – Change to a directory:

cmd cd-fuzzy ${{
  lf -remote "send $id cd $(fd --type directory | fzf)"
}}

map g cd-fuzzy

Quitting from log results in panic

Reproduce:
While in hunter in any state, even just after starting the program:

  1. press l for log view
  2. press q to quit

Expected: hunter should quit cleanly

Actual: hunter panics, ^C required to exit

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/libcore/result.rs:999:5
stack backtrace:
   0:        0x10067a7f3 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h42ef8f910989f2a5
   1:        0x100676792 - std::sys_common::backtrace::_print::h57563d504eb2a535
   2:        0x100679716 - std::panicking::default_hook::{{closure}}::hd122b1df844d64a4
   3:        0x1006794bf - std::panicking::default_hook::h95cc52151fdfa338
   4:        0x100533d60 - hunter::die_gracefully::{{closure}}::h4943948830babf57
   5:        0x100679f70 - std::panicking::rust_panic_with_hook::h14fcc8bcee6073e2
   6:        0x1006799bc - std::panicking::continue_panic_fmt::ha9475004e44b6b49
   7:        0x1006798a8 - rust_begin_unwind
   8:        0x1006917c1 - core::panicking::panic_fmt::h6b286a6a4688064c
   9:        0x1004d1e92 - core::result::unwrap_failed::h4a6b49db654acb5f
  10:        0x1004e6715 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3b996df650fb3134
  11:        0x1004e81e1 - std::panicking::try::do_call::haf5b9d3e62f44c81
  12:        0x1006820ae - __rust_maybe_catch_panic
  13:        0x1004ff1a1 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h8de97fa96955d774
  14:        0x10066c2cd - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h981e060567c31168
  15:        0x10068175d - std::sys::unix::thread::Thread::new::thread_start::h565ff451d36149b1
  16:     0x7fff666c32ea - _pthread_body
  17:     0x7fff666c6248 - _pthread_start
^C

Note that ^C in the above output is not an interrupt of the output, the full backtrace is shown.


macOS 10.14.4 (18E226)
rustc 1.36.0-nightly (3991285f5 2019-04-25)

State dependency on libmagic

Compilation on Xubuntu 18.04 failed due to a missing library:

= note: /usr/bin/ld: cannot find -lmagic
       collect2: error: ld returned 1 exit status

Installing the libmagic-dev package allowed compilation to succeed. I suggest putting all the non-Rust dependencies in the readme.

Help key binding

It would be helpful to look up the help without leaving hunter.

Publish release?

This looks like a really well built tool. I'd love to create and AUR package for hunter. It's best to build these against published releases instead of straight from git master though. I would be great if you could tag a release.

Change keybindings

Is it possible to change the keybindings? Or would I have to change the source for that?

Thread "Main" panicked at Index out of bounds

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /rustc/d628c2e642c6f8f85f24dd5d7f49de89b95bf682/src/libcore/slice/mod.rs:2689:10
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Ubuntu 18.04 Stable with Zsh, oh my zsh & Tmux. Let me know if there's anything else I can do to help.

I was using the "filter" function.

Issues with show_hidden and hidden folders

There are a few issues with the show_hidden implementation from what I can tell.

  • I don't think that the config flag is doing anything. I was unable to use to use to show hidden files. ( I did sone testing, I feel like the config file is not being read )
  • h which should be toggling the hidden files actually is overridden by the vim h mapping. I am guessing l has the same problem too.
  • If in a folder in a hidden dir (I am guessing without show_hidden enabled) if you try to go back since there is no listed files, it errors out.

Backtrace

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /rustc/bc44841ad2a2ad5f6c5e67b9e35ed8e7e71d4dc7/src/libcore/slice/mod.rs:2539:10
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: hunter::die_gracefully::{{closure}}
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::panicking::panic_bounds_check
  10: hunter::file_browser::FileBrowser::cache_files
  11: <hunter::file_browser::FileBrowser as hunter::widget::Widget>::refresh
  12: <hunter::file_browser::FileBrowser as hunter::widget::Widget>::on_key
  13: hunter::widget::Widget::handle_input
  14: hunter::main
  15: std::rt::lang_start::{{closure}}
  16: std::panicking::try::do_call
  17: __rust_maybe_catch_panic
  18: std::rt::lang_start_internal
  19: main


The error triggers if I go back one more step. I started hunter in the folder ~/.config/hunter

Unable to compile

I am unable to compile it on my device with the latest from master branch.

   Compiling hunter v1.0.1 (/Users/meain/Documents/Projects/projects/hunter)
error[E0432]: unresolved import `notify::INotifyWatcher`
 --> src/fscache.rs:1:14
  |
1 | use notify::{INotifyWatcher, Watcher, DebouncedEvent, RecursiveMode};
  |              ^^^^^^^^^^^^^^ no `INotifyWatcher` in the root

warning: unused import: `Watcher`
 --> src/fscache.rs:1:30
  |
1 | use notify::{INotifyWatcher, Watcher, DebouncedEvent, RecursiveMode};
  |                              ^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `hunter`.

To learn more, run the command again with --verbose.

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.