Code Monkey home page Code Monkey logo

joshuto's Introduction

Hi there 👋

Hi there, my name is Jeff.

  • 📹 I have a YouTube channel where I post videos on tech and various other things I find interesting

  • 🛠️ I have a few side projects that I am currently working on

  • Discord/Telegram: kamiyaa91

github stats

top languages

joshuto's People

Contributors

akmadan23 avatar aouerf avatar b-m-f avatar cjbassi avatar dependabot[bot] avatar dlfw avatar imbolc avatar integral-tech avatar judaew avatar kamiyaa avatar kennycallado avatar kodesoul avatar krivahtoo avatar luteran42 avatar lzzzzzt avatar makeefu avatar mblode avatar mroik avatar nonetrix avatar oo-infty avatar pantosaur avatar rqdmap avatar ruixi-rebirth avatar saeedanas avatar sushi-shi avatar vinegret43 avatar xfzv avatar xrelkd avatar yanshay avatar ztlevi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

joshuto's Issues

Remove "Char" from multi-key help output

When I press e.g. g, joshuto prints a "help" output for the available multi-keys, such as:

   Char('/')    change_directory /
   Char('M')    change_directory /mnt
   Char('d')    change_directory /dev
   Char('e')    change_directory /etc
   Char('g')    cursor_move_home
   Char('h')    change_directory ~
   Char('m')    change_directory /media
   Char('n')    new_tab
   Char('o')    change_directory /opt
   Char('r')    change_directory /
   Char('s')    change_directory /srv
   Char('u')    change_directory /usr
   Char('v')    change_directory /var

Why does it say Char('/') and not just /?

Also, the output could be sorted better - notice that "M" and "m" are far from each other.

file deletion asks for capital Y for confirmation but reacts on lowercase y

When deleting a file (dD), joshuto asks:

Delete 1 files? (Y/n)

which indicates that only a capital Y confirms deletion. Instead, a capital Y aborts deletion but instead a lowercase y confirms the deletion.

Is it a spelling mistake in the prompt or is the check implemented wrong? What's the desired behavior?

Joshuto crashes when the preview script returns binary rubish

I accidentially put a cat $path in my preview.sh for image formats when I wanted to test something, so preview.sh returned cat's output for a binary file. If that happens, Joshuto just crashes.

Of course, a user should take care that the preview script returns only sensible text, but Joshuto should handle this more gracefully and maybe give the user a hint about what went wrong.

Module level documentation.

@kamiyaa, this is a really cool project. Amazing work !.

I would like to add module level documentation so that it's easier for new
contributors like me to get a hang of the project structure.

Should I give it a go ?

Related Project / Possible Source

This has probably come up before, but just in case I thought I'd share this related project:

https://github.com/rabite0/hunter

It's another rust file manager that seems to have died. Maybe there's some salvageable aspects or it might help out down the line. Really looking forward to this project though, keep up the good work! 🙏🏽

Unbound memory usage

It looks like the application loads files/directories into a hashmap, however this operation should be bound to reduce memory usage when using joshuto for a long time.

Acceptance tests:

  • the hashmap is continuously pruned

Missing Cargo.lock

When I checkout master and run cargo build, there are all sorts of build errors to do with the tui crate. Never mind that, I just had some old checkout lying around with the wrong versions.

That said, there is still no Cargo.lock file, which should generally be committed for binary projects so that the correct dependency versions are always downloaded. See here

How do I configure so that I'm not being asked 'open with'?

Lets take for example .html files. How do I configure mime.toml so that they get opened like in lf, by the default browser.
Or more general, how do I configure mime.toml or any other of the configuration files, so that any file get opened by xdg-open with the command according to the settings in my OS. Setting xdg_open = true or to xdg_open = false in joshuto.toml does not change anything.

Panic at unwrap()

Using latest ver. on SailfishOS. Installs from crates.io or from building on-device w/ no problem, but won't open. Gives:

"thread 'main' panicked at 'called Result::unwrap() on an Err value
: JoshutoError { _kind: TomlDeError
(Error { inner: ErrorInner { kind:
NewlineInString, line: Some(25), co
l: 13, at: Some(1035), message: "",
key: [] } }), _cause: "Failed to p
arse TOML" }', src/config/keymap/ke
ymapping.rs:100:38"

Line 100 says:

"AppKeyMapping::default_res().expect()"

Context is:

"impl TomlConfigFile for AppKeyMapping {
fn get_config(file_name: &str) -> Self {
parse_to_config_file::<AppKeyMappingCrude, AppKeyMapping>(file_name)
.unwrap_or_else(Self::default)
}
}

impl std::default::Default for AppKeyMapping {
fn default() -> Self {
AppKeyMapping::default_res().expect()
}
}"

I'm not familiar with Rust code, so not sure if the error is there, or if that just indicates an error somewhere else...

Thanks

Publish binaries on new release using CI

So there's a cool project called trust that you can setup in your project, so that every time you create a new release/create a new tag, it will automatically build binaries for you using travis ci and publish them to the releases tab. This is really nice for people who want to use rust projects but don't want to have to deal with its compile times :D

edit: Looks like that project might be abandoned, but the idea is still the same. Ripgrep and Alacritty both do some sort of similar thing for their projects, so we could always check those out too.

cd with tilde expansion

I'd like to configure a shortcut for :cd ~ to quickly go to my home directory, but the command fails with

No such file or directory (os error 2)

Rework file entry representation in “TuiDirListDetailed”

Unlike ranger, joshuto does not show the size of directories (number of files and dirs inside), and does not show any size information for symlinks. Also, joshuto shows symlinked directories like files and with a wrong devicon.

Two views on the same test directory:

Ranger:
ranger_file_view

Joshuto:
joshuto_file_view

I would propose to rework joshuto's display to match ranger's. It just makes sense and the "size" of directories is quite useful.

Furthermore, ranger supports multiple (and custom) views (called “linemode”), which I use for example to show tmsu tags for each file and dir. But that's likely worth its own issue.


Edit: One more difference where the ranger variant makes more sense: When a symlink is selected, the footer bar shows the permission flags of the linked target rather those of the symlink itself, which is always lrwxrwxrwx.

I have started an experimental implementation.

Open prompt with semicolon instead of colon?

I recognized that the prompt (aka command line) in joshuto can be opened with a semicolon while I would expect a colon. I first thought that it would be a bug, maybe triggered by my keyboard layout or so. However, when checking the code, I found this:

        let cmd = KeyCommand::CommandLine("".to_string(), "".to_string());
        let keys = [Event::Key(Key::Char(';'))];
        insert_keycommand(&mut m, cmd, &keys)?;

in keymapping.rs.

So, my question is: Is this by intention? If yes, why? Vim or ranger users would expect a colon to open the prompt, I guess. Since joshuto also shows a colon as a prompt, it confuses even more.

[Feature Request] use zoxide for cd functions

I think it could be beneficial to replace cd functions with an implementation of zoxide since it is written in rust and works the same as cd with some really great additional functionality

zoxide is a blazing fast replacement for your cd command, inspired by z and autojump. It keeps track of the directories you use most frequently, and uses a ranking algorithm to navigate to the best match.
tutorial

Future and "advanced" behavior and operations

I'm coming here from lf which I like a lot (because it's ultra fast to start and walk through dirs /even network ones/ and supports easy extensibility with shell scripting).

Though there are some long-standing (multiple years) issues with lf I'd like to have fixed because they're pretty much show stoppers for much of the work I do with file managers. Coincidentally they seem to apply to joshuto as well - and if joshuto fixes them, then you have one more user (and occasional contributor especially of configuration/extension scripts 😉).

  1. gokcehan/lf#267
  2. gokcehan/lf#47
  3. gokcehan/lf#46
  4. gokcehan/lf#80
  5. gokcehan/lf#109

Other things which joshuto does differently and I'd like it to be configurable/different:

  1. gokcehan/lf#50
  2. gokcehan/lf#51
  3. gokcehan/lf#61
  4. gokcehan/lf#69

Overwriting folder

Let's say I have a folder structure like this

../test/folder

and I want to copy/overwrite (yyand po) another folder named folder into test I get File exists (os error 17). Is overwriting entire folders just not implemented or am I doing something wrong?
I usually do a manual rsync -a ... to solve it so it doesn't bother me too much. Just curious.

[Feature Request] Jump to subdirectory with fzf

This is a feature request for functionality similar to pressing alt+c with jethrokuan/fzf in fish-shell. The intended feature would use skim to jump to a particular subdirectory.

On a side note, it may be worth while to investigate using zoxide as a general replacement for cd functions so we could have history/fuzzy cd.

Support Drag and Drop

The only time I don't choose Joshuto for file management tasks is when I have to drag and drop some files into a webpage on my browser, and that's the only reason I keep pcmanfm, however it feels wrong to keep an extra program and switch programs just for that one quick step. Would it be possible to implement drag and drop with mwh/dragon, maybe as a plugin? It looks like jarun/nnn has an implementation that may be useful to peek at. Maybe we could make some glyph (or even the entire region) clickable, to drag the currently highlighted files.

Feature request: Open files with xdg-open by default

When trying to open a file that doesn't have an entry in the mimetype.toml, joshuto outputs Don't know how to open file :(, but I think it would be good to instead open the file with xdg-open on Linux and open on Mac.

Also, just wanted to say this project looks really exciting and great so far!

Command to exit and change CWD

I would like to add a feature request so that pressing a key-binding like <alt> + <return> will exit and CD to the current directory in Joshuto.

Cycling tabs with tab_switch -1 crashes

If you have several tabs, pressing Tab at the last tab cycles to the first tab. But then if you want to switch to the previous tab with Shift+Tab on the first tab, joshuto crashes.

[Feature Request] scroll preview

Hi,
It's just an idea, but now that joshuto supports previews and syntax highlighting, it will be an awesome feature to be able to scroll through the preview with '{' and '}' like '[' ']' is used to change the folder from the first column.

Invalid mimetype.toml breaks ui

If the mimetype.toml config file has invalid lines and the following steps are taken,

  1. open a file using open_with
  2. press escape.

the UI breaks.

below are some screenshots.

Invalid mimetype.toml.
invalid_mimetype_toml

Broken ui.
broken_ui

Close Joshuto when a file is opened

Whenever you open a file from within the program, it opens the selected file, however, joshuto remains open.

Is there a way to tell joshuto to exit itself after opening a file?

Add a "--choosefiles" like flag

Ranger has this option where if --choosefiles=/some/file/path is added to ranger, the selected file's path will be written to the specified path instead of being opened it. This lets certain programs like vim/neovim to use ranger as a file manager.

Latest Build Fails to Compile

When I run

cargo build

I get this I am on the latest version of Rust from RustUp and the latest MacOSX. This command is being run in iTerm2.

If I had to take a wild guess as to why this is happening I would say it is due to not using the latest Rust as is mentioned in this pull request.

All keycodes are unrecognized

I tried version 0.7.1 and upstream git.
Every key I try to use is an "Unknown keycode".
Tried with alacritty, mate-terminal, xterm.

Spawn commands executed with ":shell"

When using a command with :shell, like

[[mapcommand]]
command = "shell sxiv -t %s &>/dev/null &"
keys = [ "i" ]

joshuto waits for the process to terminate at command.status()?; in shell.rs.

For many use cases, this is pretty unhandy. Instead of using a blocking sub-process call, joshuto could just spawn the sub-process with command.spawn()?; instead.

Alternatively, joshuto could use two shell commands, one blocking and one non-blocking. (I could take that.)

Rclone mounted directories suddenly slower?

Hey I'm not sure what's happening but when I try to use Joshuto inside an rclone mounted (google drive) directory it becomes extremely slow. If I start Joshuto from another directory and navigate into my mounted directory it gets bogged down as well. This used to work fine before.

I think it may have to do with this commit. Rclone only lists files and directories as needed, and I'm guessing Joshuto is trying to recurse through child directories and figure out the size of each directory which would be extremely slow because it's a large directory tree with tons of files that all need to be accessed through an api. As a control I used pcmanfm which worked fine in the same directories.

Overwrite file isn't working

Hi,

loving this project, thanks a lot!

Seems that there is an issue with the files copy/paste function. The overwrite option ("po" Keymap line 117) gets ignored and the file/folder renamed (number gets appended). Or did I miss some configuration option?

Plus there is a little mistake in the example keymap.toml:
Must be copy_dirname instead of copy_dir (line 111) if I'm correct.

File Preview Support

This issue will track the discussion and progress of getting file previews to work

Just some food for thought on how to design this:

  • configuration format
    • how do we configure it so users can customize it to their liking
  • overhead costs
    • querying mimetype beforehand (during dirlist loading) or querying them on the fly (possibly increasing cursor movement delays)
  • passing files
    • how should we pass the file to preview scripts
  • showing previews
    • tui-rs currently does not support ansi color code parsing so parsing colors might need to be implemented in-house
    • tui-rs also uses a different method of outputting text to the terminal. A buffer is used instead of directly interacting with the terminal screen. Any terminal output not tracked by the buffer is undetected and may create residual artifacts
    • will need to figure out how to isolate preview to the given window

Error in example keymap.toml

Hi, and thanks for a lovely program!

I noticed one small error in the keymap.toml file in the example section: open_file instead of open on line 79.

Edit: found another one. The command copy_dir does not exist, line 110-112

Show Keybindings when pressing <?>

Most TUI programs have a useful list of categorized keybindings that shows when <?> or shift+/ are pressed to quickly check which-key does X, or see what commands are available to the user. I believe this is a low-input/high-return improvement for all new users. This would also make the project feel much more polished.

Control modifier for keymaps

Is there currently a way to do this? Didn't see any examples of it or anything related to it in the keymap.rs file.

Feature request: line numbers

Hi there, any possibility to have line numbers, absolute or relative, similar to vim? So that we can do vim movement like <#-j> <#-k> <#-gg> etc.?

Thanks for this program!

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.