Comments (35)
yes it works now! it moves it to trash dir without errors. Congrats
nice work
from superfile.
Issue added to xdg/trash
:-)
from superfile.
Oh, thanks for checking
I didnt test it in the usb etc, i will fix it in next few day!
from superfile.
yeah sure
from superfile.
Thanks for the information!!
I update it! xdg/trash
Update will release in v1.0.1 886dbfb
from superfile.
Nice addition, works like you did, but with the correct xdg specification. However, looking xdg/trash
, seems it doesn't use the $topdir/.Trash
specification to trash files from another partitions without copying them to the home trash folder. This could be a feature to implement later, or an issue to fill on xdg/trash
package.
from superfile.
There's definitely something wrong with this
from superfile.
@guildem
What do u think about just deleting files when in the another partitions
from superfile.
Having 2 different behaviors for one action is not what I would encourage.
Moving files from other partitions to the home trash can be time consuming and take too much space (ie. small root ssd with trash and big hdd with big files to trash), but it stays coherent. All files are trashed and can be recovered.
Having trash (and recovery) on main partition and deletion on others can lead to errors when mounting multiple partitions (I have a share
folder in my $HOME mounted on a 2TB HDD to store big files).
Temporary solution : a trash action and a delete action on the home partition, and only a delete action on other partitions.
Enhancement : getting trash on other partitions functional, by waiting xdg/trash
to be fixed or forking it and adding yourself the functionality + PR to upstream.
Would that be a good compromise to you ?
from superfile.
so this is my final solution for now
Screencast.from.2024-04-08.19-20-58.webm
from superfile.
I'm not sure to understand what you've done, but maybe the better choice is to wait for the trash package to implement other trashes itself (or make a PR) ?
from superfile.
The method I currently use is to delete it directly if it is no longer local, but a confirmation message will be displayed before deletion.
There is no xdg in macos, so macos currently deletes it directly.
And btw i dont have any Mac so i cant test it........
from superfile.
For macos you should have this (untested) : https://github.com/Bios-Marcel/wastebasket or this https://apple.stackexchange.com/a/310084 (no lib)
Globally I stay on the position that one action giving 2 different behaviors (even with a popup) isn't great, and 2 actions could be better, one for trash, one for delete (like ranger with DD
to delete and DT
to trash). And if you can't trash because unimplemented for other partitions/OSes, a popup explaining why you can't
from superfile.
OK i will try this
But the biggest problem with macos is that I don’t have a machine to test :(
haha
from superfile.
@AnshumanNeon Sorry to tag you :(
Can you help me test whether the new version will throw files into the trash can on MacOs?
from superfile.
at function.go 826 you access the element of an array at index 0. but the array is empty. That means it isn't initalized. It should have at least a null value before accessing it.
from superfile.
Oh I know why.
You can try to regenerate hotkeys.toml
I added some hotkeys and I think that's why it's causing this error
from superfile.
I rebuilt the whole config folder. but it is showing error on deleting. and the file isn't deleted
from superfile.
Ok thanks for your testing!
Can you send it back to me to see the contents of superfile.log?
Should be in ~/.cache/superfile
from superfile.
2024/04/14 14:43:41 err when open file with xdg-open:
2024/04/14 14:43:41 exec: "xdg-open": executable file not found in $PATH
2024/04/16 21:33:57 Delete single item function move file to trash can error
2024/04/16 21:33:57 exit status 1
2024/04/16 21:34:21 Delete single item function move file to trash can error
2024/04/16 21:34:21 exit status 1
2024/04/16 21:38:39 Delete single item function move file to trash can error
2024/04/16 21:38:39 exit status 1
superfile.log logs. so you are trying to call "xdg-open" which is a program that needs to be installed?
from superfile.
// ...
} else if len(panel.element) > 0 && !panel.element[panel.cursor].directory {
cmd := exec.Command("xdg-open", panel.element[panel.cursor].location)
_, err := cmd.Output()
if err != nil {
outPutLog("err when open file with xdg-open:", err)
}
}
// ...
}
2024/04/14 14:43:41 err when open file with xdg-open:
2024/04/14 14:43:41 exec: "xdg-open": executable file not found in $PATH
I think this is another error.
from superfile.
https://superuser.com/a/913226
as mentioned in this answer, you should probably use "open" command for darwin
from superfile.
2024/04/16 21:52:09 Delete single item function move file to trash can error
2024/04/16 21:52:09 exit status 1
this is the error when trying again after installing xdg-utils
from superfile.
Ok i got it.
I'll fix it in 7d03edf
And about the Macos trash can, I think I'll fix it tomorrow :(
from superfile.
no problem
from superfile.
@MHNightCat i found a really easy solution. It is in this thread https://apple.stackexchange.com/a/310084 mentioned by @guildem
I am talking about this specific solution: https://apple.stackexchange.com/a/335164
it is easy and cheap and it works on my mac.
from superfile.
bb55ece
Thanks for responding, I already updated it!
from superfile.
but this is what is already there. That osascript isn't working.
from superfile.
Oh~ ok got it i will update again!
from superfile.
@AnshumanNeon I update it in 5dfbcb9
from superfile.
Does this work?
I think after this fix this issue i will release v1.1.0
from superfile.
no it doesn't. Here is the log:
2024/04/19 17:14:01 Delete single item function move file to trash can error
2024/04/19 17:14:01 exit status 1
from superfile.
sorry for being late
from superfile.
It's fine!
I update it again in d34ee13
Could you please give it a try?
from superfile.
OK, thanks for testing!
I close this issue for now.
But if you have any better ideas about this, feel free to reopen
still can’t put the files on the external hard drive into the trash btw
from superfile.
Related Issues (20)
- Can't launch superfile with a read-only config file HOT 5
- Feature Request: Vim-like Keybindings for spf HOT 1
- Can't create file or folder HOT 2
- Folder preview's icons has transparency issue HOT 3
- Use built-in unix command `stat` instead of `exiftool` HOT 1
- Feat.: add an uninstall script HOT 2
- Wrong hotkeys in hel menu (whitch open by ?) HOT 1
- Use xdg-user-dirs in sidebar HOT 1
- Feature Request: Add Shift + Delete to Permanently Delete Files Without Using Trash Can HOT 1
- Add Undo/Redo operations HOT 1
- Create too many instances of `exiftool` HOT 1
- Vim bindings in docs cause error on nixos HOT 3
- Creating sym-link by spf
- Superfile doesn't render small text files HOT 2
- Problem with torrents HOT 1
- Compress all files selected
- Going to System32 folder instead of parental directory
- Messed up rendering in hyper terminal HOT 2
- Windows 10?/11 Ctrl+d does not delete file or move it to the trash
- typo in default hotkeys .toml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superfile.