Giter VIP home page Giter VIP logo

fuf's Introduction

I never asked for this

why internets rms email debian arch irc neko vim_on_fire piracy chrmevil computer ascii4ever quake

fuf's People

Contributors

ckath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fuf's Issues

preview script cleanup

at the moment its still very much a ripped apart and taped back together scope.sh from ranger, could go with cleaning and simplifying. maybe also list the dependencies it takes to get it fully working.

edit: pretty much implemented

resizing while loading segfaults

while scrolling/loading lockups and segfaults are mostly handled, the resize handling seems to still cause a lot of issues. when loading previews or directories resizes seem to trigger a lot of crashes.

double preview render

seems on cases like gg and G it renders the previous preview again, then the right one.
this means if the top/bottom is a text one an image will be over it.

possible fixes:

  • clear preview always, thought I did this?
  • kill preview rendering on these keys, not sure if that'll fix it yet

figure out a way to detect parameters for w3m previews

partly #1 but I feel like I'll leave this regardless of cleaning the script up. as of now some things are manually configured to finetune the w3m preview:

fuf/scripts/preview

Lines 11 to 16 in 5cc60b6

# preview img position/size config, this changes for each font and terminal
# you will have to tweak this
offset_w=27
offset_h=10
max_w=$((width*7-5))
max_h=$((height*13))

from brief testing it seems these differ per terminal/font and cause the preview to become misaligned or incorrectly sized. there should be some way to detect this correctly automatically as a few other cli fms seem to handle this just fine.

allow full redraw

whenever things mess up and the layout gets fuckered a refresh_layout which gets called all the time doesnt fix it, something like redrawing the entire layout forcefully with a keybind might be useful, unless all the corruption issues are fixed.

crashes on empty directory refreshes

either going into an empty directory, creating an item, then refreshing or deleting the last item and then refreshing, causes a crash. since going back on directory and then into the current directory doesnt crash I'd imagine its a small thing with the items array

open_file() issues with different open scripts

open_file relies on an extremely terrible hack/implementation for getting what program is launched:

fuf/fuf.c

Lines 201 to 215 in fae24ca

char proc_path[256];
char proc_name[256];
int proc_pid = 0;
FILE *f;
sprintf(proc_path, "/proc/%d/task/%d/children", pid, pid);
usleep(200000); /* 200ms, time open handler has to start program */
f = fopen(proc_path, "r");
fscanf(f, "%d", &proc_pid);
fclose(f);
if (proc_pid) { /* a program was launched by open handler */
sprintf(proc_path, "/proc/%d/comm", proc_pid);
f = fopen(proc_path, "r");
fgets(proc_name, 256, f);
fclose(f);

while rewriting the open script to fix #2 I already made it unusable.

steps to fix:

  • helper function for child pid name in sysext
  • wait properly on files to be populated, no sleeping x amounts
  • account for deeper levels of child processes, the new open script launches the program under too /bin/bash parents, this should scale infinitely

this will be implemented in the same branch as the #2 issue: open_improvement

fix open_with

open_with seems to work very inconsistently, some directories it doesnt work, others it does. this needs to be fixed to work solid

corruption of ui and segfaults while scrolling rapidly

image
possibly related to #3, though it also happens when loading is well and done. it seems most reproducible when scrolling over audio files(using mediainfo without exiftool) but can also happen at random. sometimes its fixable with an R, other times the entire terminal requires a restart. this might be related to the shoddily implemented ext_kill:

fuf/ext/sysext.c

Lines 13 to 31 in 2f9e773

void
ext_kill(pid_t pid, int sig)
{
FILE *f;
char proc_path[256];
while(pid) {
sprintf(proc_path, "/proc/%d/task/%d/children", pid, pid);
if (!(f = fopen(proc_path, "r"))) {
kill(pid, sig);
break;
}
pid_t child_pid;
fscanf(f, "%d", &child_pid);
fclose(f);
kill(pid, sig);
pid = child_pid;
}
}

which might conflict with some programs the preview script runs, will need further looking into to find the actual cause of this happening. another possibility is the threading model(killing and joining threads rapidly) is too stupid to work.

freezing of ui

there are cases where fullscreening something freezes the ui from updating, seems to differ per system how easy this is to trigger but it isnt great that its possible to begin with

race conditions between preview and loading

currently its possible to quickly load a directory while the preview script is still loading, this causes corruption as both threads try to update the screen. there are more unspecified ways to trigger this, the best would be a solution to stop the threads colliding at all.

location bookmarks

I think it would be great if fuf had bookmarks so you can go to any directory specified in a bookmarks file assuming it exists. The user should be responsible to create this instead of it being automatically generated, unless you think it should be otherwise? I already have it working but its hardcoded, I think changing it to read a file with absolute paths makes sense. A goto should start with 'g' so you could have "gd" with the absolute path after that as goto documents for instance. I'm not planning on adding any fancy file edit operations as you state in the README, this isn't a goal of fuf, but I'm curious about your opinions on this feature.

proper install procedure

currently the binary is just there in the dir you built it and it can be symlinked to the bin dir with strap, this relates to #5 since scripts are similarly symlinked to the ~/.config/fuf dir from here.

ideally make install would setup the scripts in a sensible default location (after #5 is realized), and throw the bin in /usr/bin

extend open script

the open script is currently very, very minimal. could go with some more filetypes to recognize and open in sensible software

human readable sizes

currently sizes are displayed as is from stat, because I'm lazy. it'd be nice to have B/KB/GB/TB etc instead

expand/improve default scripts

the default open and preview scripts are merely ported and stripped down versions of rangers scripts, as I don't personally use a lot of programs I'm not sure how sensible these defaults are.

the following open/preview improvements are always welcome either as comment, separate issue or pr:

  • implementations of unsupported filetypes
  • more sensible order of programs or filetypes
  • more alternative programs to handle filetypes
  • any other arguable improvements

cwd display reworking

these get cut off from the beginning, incorrectly. ideally they'd be given a longer space to fit in, or at the very least cut them of correctly at the end. this happens at some sizes and not at others

path shown correctly, see Unconnected

image

path shown incorrectly, see Unconnecte

image

previews dont always get started

there are cases where after a canceled long loading preview (rendering a huge image, loading a directory that gets stuck) the next file doesn't preview correctly. however the file after that, or a reload (r) will preview fine. the issue isn't always reproducible.

I suspect this is something to do with the shoddily implemented preview thread, which is a huge pain in the ass to debug

large directories dont always start loading

sometimes really large directories hang at "loading: 0", a later attempt always works. cancelation of this hang is also not possible. either would fix this issue:

  • figure out why the directory doesnt load at times and make sure that never happens
  • find out where it gets stuck and allow the operation to be canceled

it might also be this is just file io being file io (I can nearly hang loading when loading with multiple file managers too). in which case I'll just close this later

handle current directory getting deleted

right now the cwd at the top causes issues when the directory is deleted:
image
it'd be nice to handle this similarly to the old 'file not found' in bold red to notify the user without throwing errors in the screen.

built in shell access

since fuf doesnt do any file edit operations it would make sense to make a 'open shell in current directory' feature. fuf would wait for the shell to exit to continue. probably bind it to s or something

default config location

currently fuf checks for the open and preview scripts in ~/.config/fuf/{open,preview}. its far more sensable to check for them in a default location and let users overwrite them with custom their own scripts in ~/.config/fuf.

show uid/gid even when unresolvable

currently I've made it show ??? for users and groups that dont resolve:
image

but I've recently found some uses for being able to see the raw numerical id it has even when the local system cant resolve it, so it makes more sense to display those instead.

open with

a keybind to open the current file with a program of choice the user is prompted for, bypassing the open script.

better loading canceling

atm when you cancel loading (by pressing literally any key) it just stops dead in its tracks and handles the next keypress. while this works for most cases, it doesnt make a lot of sense when you're going back directories (h), in which case l will select a random directory from the currently loading directory.

this should be changed to make l stay in the shown directory, a variable goto_item is already defined and used to handle selecting this directory, so implementation of this extra functionality should be trivial.

optimization causes segfaults in color parsing

when compiling with any optimization (-Os -O2 -O3 etc) fuf segfaults, I've run it through sanitizers and debuggers with limited success. this should probably be fixed at some point, unless a newer gcc version will suddenly start to like it.

add shell completion

some basic completion for the few command line options would be neat, at least for the zsh and bash shell. info can just be the same as is in usage (-h)

since I'll implement them separately I'll just leave this checklist:

  • bash completion
  • zsh completion

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.