2
3
Fork
You've already forked ncsu
0

Make it possible to add shortcut commands to run on file/folder #269

Closed
opened 2025年12月18日 21:05:46 +01:00 by yarikoptic · 1 comment
yarikoptic commented 2025年12月18日 21:05:46 +01:00 (Migrated from code.blicky.net)
Copy link

THANK YOU for ncdu. I used it regularly and it saved me lots of ... bytes.

I am also a developer of https://datalad.org/ and thus a heavy user of https://git-annex.branchable.com and have lots of folders with git-annex repositories where I do not want to "[D]elete" a file but rather run a git-annex drop or better (can do through submodules as well) datalad drop -r command on that given path to drop the content but not remove the files (symlinks). Not sure if worthy for every ncdu user so thought to suggest it to make 'pluggable', e.g. make it so if --shortcut-x="CMD {}" is defined, then for keypress x, it would run CMD PATH thus replacing {} with the PATH selected in ncdu. Then I could define my own for dropping in .config/ncdu/config or alike.

THANK YOU for `ncdu`. I used it regularly and it saved me lots of ... bytes. I am also a developer of https://datalad.org/ and thus a heavy user of https://git-annex.branchable.com and have lots of folders with git-annex repositories where I do not want to "[D]elete" a file but rather run a `git-annex drop` or better (can do through submodules as well) `datalad drop -r ` command on that given path to drop the content but not remove the files (symlinks). Not sure if worthy for every `ncdu` user so thought to suggest it to make 'pluggable', e.g. make it so if `--shortcut-x="CMD {}"` is defined, then for keypress `x`, it would run `CMD PATH` thus replacing `{}` with the PATH selected in ncdu. Then I could define my own for dropping in `.config/ncdu/config` or alike.
yorhel commented 2025年12月19日 07:21:39 +01:00 (Migrated from code.blicky.net)
Copy link

I'm not planning to add custom keybindings/commands, but you can get similar functionality with the --delete-command option added in ncdu 2.9. You can pass it a script that calls rm or your own commands based on the path, or interactively ask for the desired action.

For older versions there's also the option of abusing NCDU_SHELL with some scripting.

I'm not planning to add custom keybindings/commands, but you can get similar functionality with the `--delete-command` option added in ncdu 2.9. You can pass it a script that calls `rm` or your own commands based on the path, or interactively ask for the desired action. For older versions there's also the option of abusing `NCDU_SHELL` with some scripting.
Sign in to join this conversation.
No Branch/Tag specified
zig
zig0.16
master
zig-threaded
openat
chdir
clear
compll
v2.9.3
v2.9.2
v2.9.1
v2.9
v2.8.2
v2.8.1
v2.8
v1.22
v1.21
v2.7
v2.6
v2.5
v1.20
v2.4
v1.19
v2.3
v1.18.1
v2.2.2
v1.18
v2.2.1
v2.2
v1.17
v2.1.2
v2.1.1
v2.1
v2.0.1
v2.0
v2.0-beta3
v2.0-beta2
v2.0-beta1
v1.16
v1.15.1
v1.15
v1.14.2
v1.14.1
v1.14
v1.13
v1.12
v1.11
v1.10
v1.9
v1.8
v1.7
v1.6
v1.5
v1.4
v1.3
v1.2
v1.1
No labels
1.x
2.x
bug
feature
imported
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
selfisekai/ncsu#269
Reference in a new issue
selfisekai/ncsu
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?