Skip to content

fix: trash.cmd defaults to 'trash' on macos #2336

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

Merged
merged 6 commits into from
Aug 13, 2023
Merged

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Jul 24, 2023

fixes #1366

--- Apply OS specific localisations to DEFAULT_OPTS
local function localise_default_opts()
if utils.is_macos then
DEFAULT_OPTS.trash.cmd = "trash"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be gio trash?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I get confused. I was under the impression that gio would put the files in ~/.local/share/Trash/files which is not recognised by macos.

Perhaps we should just update the doc, removing "Trash is unavailable" and noting the available homebrew options for macos users.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be time for me to use https://github.com/sickcodes/Docker-OSX

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we found that neither trash nor gio comes preinstalled on macOS so it's best to do what you said, which is to warn the users that D is not available unless you install trash from homebrew. We shouldn't use gio trash on macOS as it moves the file to a different location than ~/.Trash which is where the Bin icon is pointing to.

@alex-courtis
Copy link
Member Author

Updated to include the windows trash changes #2335

@linrongbin16
Copy link
Contributor

linrongbin16 commented Aug 6, 2023

Hi, @alex-courtis, there's no such default trash command on Windows.
People have to install third party command to make it work. For now, the most porpular one is: https://github.com/sindresorhus/trash-cli. The command is just: trash.

For macOS/Linux, I also don't know if there is such a default command. I always install third party via nodejs or python.

@alex-courtis
Copy link
Member Author

Thanks mate. Adding to the doc.

@linrongbin16
Copy link
Contributor

sure thing

Copy link
Contributor

@linrongbin16 linrongbin16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alex-courtis alex-courtis merged commit 0a54dcb into master Aug 13, 2023
@alex-courtis alex-courtis deleted the 1366-macos-trash branch August 13, 2023 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn users when trash command is not available
4 participants