Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for custom trash command #1978

Merged
merged 2 commits into from
Jan 5, 2025
Merged

Conversation

N-R-K
Copy link
Collaborator

@N-R-K N-R-K commented Jan 4, 2025

this makes it so that if NNN_TRASH is set to a string other than "1" or "2" then it is accepted as the trash command to run.

this allows us to support arbritary trashing utilities while also maintaining backwards compatibility for older "1" & "2" values.

Fixes: #1168
Fixes: #1963
Fixes: #1960
Fixes: #1761

@N-R-K
Copy link
Collaborator Author

N-R-K commented Jan 4, 2025

Haven't updated the docs yet. Some of the patches might need updating too. I'll fix them if this approach is deemed acceptable.

Looks like a relatively easy way to support arbitrary trashing utilities, and we're getting lots of request for custom trash utility support. What do you guys think? @jarun @KlzXS

src/nnn.c Outdated Show resolved Hide resolved
@jarun
Copy link
Owner

jarun commented Jan 4, 2025

Approach looks good to me.

@N-R-K N-R-K force-pushed the custom-trashcmd branch 2 times, most recently from 066eb3a to 3a91429 Compare January 4, 2025 16:12
@N-R-K N-R-K marked this pull request as ready for review January 4, 2025 16:14
@N-R-K N-R-K changed the title WIP: add support for custom trash command add support for custom trash command Jan 4, 2025
this makes it so that if $NNN_TRASH is set to a string other
than "1" or "2" then it is accepted as the trash command to run.

this allows us to support arbritary trashing utilities while
also maintaining backwards compatibility for older "1" & "2"
values.

Fixes: jarun#1168
Fixes: jarun#1963
Fixes: jarun#1960
Fixes: jarun#1761
@jarun
Copy link
Owner

jarun commented Jan 5, 2025

CI is failing. Please check:

./patches/check-patches.sh
7
O_COLEMAK=1 O_GITSTATUS=0 O_NAMEFIRST=0 O_RESTOREPREVIEW=0 [SUCCESS]
8
O_COLEMAK=0 O_GITSTATUS=1 O_NAMEFIRST=0 O_RESTOREPREVIEW=0 [SUCCESS]
9
O_COLEMAK=1 O_GITSTATUS=1 O_NAMEFIRST=0 O_RESTOREPREVIEW=0 [SUCCESS]
10
O_COLEMAK=0 O_GITSTATUS=0 O_NAMEFIRST=1 O_RESTOREPREVIEW=0 [SUCCESS]
11
O_COLEMAK=1 O_GITSTATUS=0 O_NAMEFIRST=1 O_RESTOREPREVIEW=0 [SUCCESS]
12
O_COLEMAK=0 O_GITSTATUS=1 O_NAMEFIRST=1 O_RESTOREPREVIEW=0 [SUCCESS]
13
O_COLEMAK=1 O_GITSTATUS=1 O_NAMEFIRST=1 O_RESTOREPREVIEW=0 [SUCCESS]
14
O_COLEMAK=0 O_GITSTATUS=0 O_NAMEFIRST=0 O_RESTOREPREVIEW=1 [FAILED]
15
O_COLEMAK=1 O_GITSTATUS=0 O_NAMEFIRST=0 O_RESTOREPREVIEW=1 [FAILED]
16
O_COLEMAK=0 O_GITSTATUS=1 O_NAMEFIRST=0 O_RESTOREPREVIEW=1 [FAILED]
17
O_COLEMAK=1 O_GITSTATUS=1 O_NAMEFIRST=0 O_RESTOREPREVIEW=1 [FAILED]
18
O_COLEMAK=0 O_GITSTATUS=0 O_NAMEFIRST=1 O_RESTOREPREVIEW=1 [FAILED]
19
O_COLEMAK=1 O_GITSTATUS=0 O_NAMEFIRST=1 O_RESTOREPREVIEW=1 [FAILED]
20
O_COLEMAK=0 O_GITSTATUS=1 O_NAMEFIRST=1 O_RESTOREPREVIEW=1 [FAILED]
21
O_COLEMAK=1 O_GITSTATUS=1 O_NAMEFIRST=1 O_RESTOREPREVIEW=1 [FAILED]
22
make: *** [Makefile:340: checkpatches] Error 1
23
Error: Process completed with exit code 2.

@jarun jarun merged commit e59b83d into jarun:master Jan 5, 2025
7 checks passed
@jarun
Copy link
Owner

jarun commented Jan 5, 2025

Thank you! Please update the docs so that users can easily use it.
Probably we need to add some details for NNN_TRASH here: https://github.com/jarun/nnn/wiki/Usage#configuration

@N-R-K N-R-K deleted the custom-trashcmd branch January 5, 2025 16:58
@N-R-K
Copy link
Collaborator Author

N-R-K commented Jan 5, 2025

Please update the docs so that users can easily use it.

I've already updated the manpage in this PR. Will update the wiki soon.

@jarun
Copy link
Owner

jarun commented Jan 5, 2025

I meant the wiki...

@N-R-K
Copy link
Collaborator Author

N-R-K commented Jan 5, 2025

I meant the wiki...

Done.

@jarun
Copy link
Owner

jarun commented Jan 6, 2025

Thank you so much!

@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trash on macOS
2 participants