afify / sfm Goto Github PK
View Code? Open in Web Editor NEWsimple file manager
License: ISC License
simple file manager
License: ISC License
when any symlink loads it causes a buffer overflow and the program immediately terminates,
Mostly coming from lf file manager, but I believe that quick access to shell could be really handy. Either in a form of a shell bar appearing on a key press, akin to how filter works now.
Or just have a key to open current folder in a shell. Like, you press key, get into terminal from the same folder you were in, do what you want, type exit and get back to the file manager.
i want to use vim to open no extension file, but when i set an empty string it don't work
After upgrading to 0.3 I have such issue:
$ readlink ./result
/nix/store/73shvirhxz8088jlnvk9j53yrr6vz28s-sfm-0.3
$ ./result/bin/sfm
*** buffer overflow detected ***: terminated
fish: Job 1, './result/bin/sfm' terminated by signal SIGABRT (Abort)
$ coredumpctl gdb
...
(gdb) bt
#0 0x00007f2c84a2abaa in raise ()
from /nix/store/cvr0kjg2q7z2wwhjblx6c73rv422k8cm-glibc-2.33-47/lib/libc.so.6
#1 0x00007f2c84a15523 in abort ()
from /nix/store/cvr0kjg2q7z2wwhjblx6c73rv422k8cm-glibc-2.33-47/lib/libc.so.6
#2 0x00007f2c84a6b2e8 in __libc_message ()
from /nix/store/cvr0kjg2q7z2wwhjblx6c73rv422k8cm-glibc-2.33-47/lib/libc.so.6
#3 0x00007f2c84af8382 in __fortify_fail ()
from /nix/store/cvr0kjg2q7z2wwhjblx6c73rv422k8cm-glibc-2.33-47/lib/libc.so.6
#4 0x00007f2c84af6e40 in __chk_fail ()
from /nix/store/cvr0kjg2q7z2wwhjblx6c73rv422k8cm-glibc-2.33-47/lib/libc.so.6
#5 0x00007f2c84af7374 in __realpath_chk ()
from /nix/store/cvr0kjg2q7z2wwhjblx6c73rv422k8cm-glibc-2.33-47/lib/libc.so.6
#6 0x0000000000402cc9 in ?? ()
#7 0x0000000000403f14 in ?? ()
#8 0x0000000000404528 in ?? ()
#9 0x000000000040261e in ?? ()
#10 0x00007f2c84a16780 in __libc_start_main ()
from /nix/store/cvr0kjg2q7z2wwhjblx6c73rv422k8cm-glibc-2.33-47/lib/libc.so.6
#11 0x000000000040274a in ?? ()
$ cd result
$ ./bin/sfm
...sfm runned OK...
Again, there were no such issue with 0.2.
There is no such problem on macOS.
Hello!
I have been playing around with sfm
and it is very neat and lightweight! I was wondering on the choices on default applications. Would it be useful to not have apps choose between (or fall back to) xdg-open
or some predefined apps? I am sure you have thought of this, but having a configuration file of some sort to set some defaults? Or define new filetypes that an be added to the images/arts/pdf/obj/etc... extensions. I was curious if this was in the works.
Otherwise awesome!
Is it possible to bind some key for hiding/unhiding dotfiles? They are usually distracting.
like having all things thas actualy make a graphical windows manager like manage usb and devices and what app opens a file (MIME types)
Does'nt open after installation. error show [FAILED 1773] tb_init()
I just compiled sfm and like it very much already. Thanks for providing this! I ran into one stumble block though...
I doesn't seem to be possible to use spaces or non-english characters when renaming files with the cw command. Is this a bug? Would it be possible to add this functionality?
Also, if the filename is very long (like 60 characters), you only get the remaining character space left on the line to use for renaming the file (like 10 characters). Perhaps to skip showing the original name on the editing line could be a good idea (since you see which file you have selected for editing in the file list above anyway). Or rather, one could have the original name there for editing (like if you have a long filename and just want to change one or two characters).
So what do you say?
An issue that I spotted is when I try to run sfm from a script, it fails to start.
I tried "st -e sfm", "st sfm" or just a script with sfm, but nothing succeded unfortunately.
Hi @afify,
So I figured the pull request was not a good place for this conversation. I went to build on mac with and I am seeing this,
$ make
sfm build options:
CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wvla -O3 -g -DVERSION="0.1" -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
LDFLAGS = -pthread -s
CC = cc
cc -c -std=c99 -pedantic -Wall -Wextra -Wvla -O3 -g -DVERSION=\"0.1\" -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -D_BSD_SOURCE sfm.c
sfm.c:481:6: error: use of undeclared identifier 'show_perm'
if (show_perm == 1) {
^
sfm.c:488:6: error: use of undeclared identifier 'show_ug'
if (show_ug == 1) {
^
sfm.c:499:6: error: use of undeclared identifier 'show_dt'
if (show_dt == 1) {
^
sfm.c:508:6: error: use of undeclared identifier 'show_size'
if (show_size == 1 && S_ISREG(cursor->mode)) {
^
sfm.c:588:44: warning: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Wformat]
if (snprintf(result, result_len, "%ld%c", size, unit) < 0)
~~~ ^~~~
%lld
/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
sfm.c:1144:12: warning: variable length array used [-Wvla]
char *argv[argc + 2];
^
2 warnings and 4 errors generated.
make: *** [sfm.o] Error 1
Which is the same error I am getting on OpenBSD. It seems you have the structs defined in sfm.c but the variables defined in config.def.h. I am sure this is something you are seeing.
sfm.c lines 229-230...
else if (snprintf(full_path, PATH_MAX, "%s/%s", dir_name, file_name) > PATH_MAX)
die("Path exided maximun length");
See https://stackoverflow.com/questions/54084570/how-to-detect-snprintf-errors
So something like
else {
int ret = snprintf(full_path, PATH_MAX, "%s/%s", dir_name, file_name);
if (ret < 0)
die("snprintf encoding error");
else if (ret >= PATH_MAX)
die("Path exceeded maximum length");
}
I found sfm wonderfull, but in my opinion (sense of taste, if you will), I feel rare having 2 panes, is there an option or a flag to only have 1 pane, or do I need to modify sfm.c in order to achieve that.
Thansk in advance!!!
Pg-Dn
or j
)Pg-Up
or k
)There is no way to scroll to actual top.
It should be possible to scroll up to actual top.
Make it so sfm does not closes itself after pressing control c in mpv/sxiv.
My idea is making it so mpv stops running after i kill it with control c but sfm stays
Maybe using the same system used to default apps, and using blank as fallback. Probably better to have it in a separate file than making config.h too large.
I opened and edited some files with sfm and left it open for a while then eventually double free or corruption (!prev)
and Aborted (core dumped)
showed up and sfm crashed. I am using st and tmux.
why do I need a file manager that can't run files?
Hi @afify ,
As requested, here is the new issue explaining the visual copy problem.
I am able to copy files and see them update, however, it only copies a subset of files on both systems. If I copy 5 it may paste 3; this happens on both systems (see below for a video of both). Also, in some cases I can get it to trigger a segfault on delete d
, when I select too many files, there is a "Cannot allocate memory" on mac and a core dump on OpenBSD.
Video demonstrations
In my case I run on dedicated hardware for OpenBSD, which I have two machines a laptop and a server. Both exhibit the same issue. And for additional context on OpenBSD I run xterm
and an mac I am running their vanilla Terminal v2.8.3
.
Would be really nice to see an option of setting custom colors, for example, in the config.h file.
I did try to open sfm in st using "st -e sfm" got an error - child terminated due to signal 11
from dwm I couldn't open the sfm and found error in dmesg
dwm config
static const char *sfmcmd[] = { "st","-e","sfm", NULL };
dmesg :
[ 2191.463223] sfm[12387]: segfault at 55c692b3a044 ip 000055c6928d0e5e sp 00007ffcfe4138f0 error 4 in sfm[55c6928cf000+5000]
[ 2228.099152] sfm[12567]: segfault at 56022a04c044 ip 00005602297f2e5e sp 00007ffceb439f60 error 4 in sfm[5602297f1000+5000]
$ coredumpctl info
PID: 107363 (sfm)
UID: 1000
GID: 1000
Signal: 11 (SEGV)
Timestamp: Thu 2021-08-05 13:54:14 BST (3h 15min ago)
Command Line: sfm
Executable: /usr/local/bin/sfm
Control Group: /user.slice/user-1000.slice/session-1.scope
Unit: session-1.scope
Slice: user-1000.slice
Session: 1
Owner UID: 1000
Storage: /var/lib/systemd/coredump/core.sfm.1000.67236f5e79e74e349e45ad8d57fb1103.107363.1628168054000000.zst (present)
Disk Size: 26.7K
Message: Process 107363 (sfm) of user 1000 dumped core.
Found module linux-vdso.so.1 with build-id: 67a240aff4f3f650a6de241a4cf5a0a6148d7fac
Found module ld-linux-x86-64.so.2 with build-id: 040cc3dd10461562f177df39e3be2f3704258c3c
Found module libc.so.6 with build-id: 4b406737057708c0e4c642345a703c47a61c73dc
Found module libpthread.so.0 with build-id: 07c8f95b4f3251d08550217ad8a1f31066229996
Found module sfm with build-id: 7c9f4d52cde0a8b47c3bce0612a1dc7eb0e6326c
Stack trace of thread 107363:
#0 0x000055805b694e5e n/a (sfm + 0x5e5e)
#1 0x000055805b69548c n/a (sfm + 0x648c)
#2 0x000055805b6935f7 n/a (sfm + 0x45f7)
#3 0x00007f31a41d2b25 __libc_start_main (libc.so.6 + 0x27b25)
#4 0x000055805b69371e n/a (sfm + 0x471e)
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.