I'm quite puzzled by the following issue. I tried to open XQuartz after some time I hadn't used it and I got a dialog box saying "The application "XQuartz" can't be opened." I went through all the usual troubleshooting steps (deleting preferences and caches, and reinstalling the application) to no avail. After further troubleshooting I discovered that:
- it only happens in my account; i.e., XQuartz works for other accounts on the same laptop;
- it only happens when trying to open XQuartz from Finder; i.e., if try to open XQuartz from the command line with
open /Applications/Utilities/XQuartz.app, XQuartz opens properly.
I suspect the issue has something to do with environment variables, possibly the PATH variable, for applications launched through Finder, but I'm not sure how to troubleshoot that. Any suggestions? I'm on macOS Catalina 10.15.7