Search code examples
shellfish

Getting an error "cd: '/Users/x/Downloads/' is a rotten symlink" in Fish shell


Today I logged onto my machine and tried to cd ~/Downloads, but my shell (Fish) just returns the error cd: '/Users/x/Downloads/' is a rotten symlink without any further information.

It seems to originate from Fish's builtin_cd function call here, however I can't tell what the reason is since my Downloads directory is not symlinked.

I'm able to cd into any other directory just fine and I'm able to access Downloads through MacOS's UI (Finder) so I don't think the directory data has been corrupted.

Does anyone know what the cause of this error could be and/or how to fix it?

edit: I've already tried reinstalling Fish from my package manager (homebrew), to no avail.


Solution

  • Your terminal app is forbidden from accessing the Downloads directory. You can fix it like so:

    1. Open Security and Privacy preference pane
    2. Click on the Privacy tab
    3. Select "Files and Folders" in the side bar
    4. Find your terminal app, and ensure that the Downloads directory is checked for it

    You'll have to relaunch the terminal before it can get access.