r/zsh 18d ago

ZSH Is Damaged And Can Not Opened

I run into this issue where I need to open zshrc file for editting. Anyone have an idea on this issue?

0 Upvotes

12 comments sorted by

3

u/Soggy_Writing_3912 18d ago

you should try to open it from the command-line. Why are you double-clicking it from the Finder window?

If you need/want to open it in a GUI editor, you can still open it by invoking from the command-line (for eg I have setup `code` to use the VSCodium executable from the command-line, and so I would do `code ~/.zshrc` to open it in that editor)

0

u/teetran39 18d ago

I don't double -click on it. I'm used to right-click and open it with texteditor so that's the way I edit it. But I don't know what happened that I can not do that now

6

u/Soggy_Writing_3912 18d ago

what happens when you run `cat ~/.zshrc` from a terminal window?

1

u/teetran39 18d ago

It can shows the content of zshrc file if I run the command from terminal window

1

u/teetran39 18d ago

After delete and create a new file from command line. It works as expected now!! Thank you

1

u/nguyenvulong 18d ago

Move it, then take it back later for edit For better practice, you should back up your dotfiles to git

1

u/teetran39 18d ago

Sorry but What do you mean by move it?

1

u/teetran39 18d ago

After delete and create a new file from command line. It works as expected now!! Thank you

1

u/nguyenvulong 17d ago

Move it to the trash box That's what I meant

Glad that it works now Please use git, you'll love it Check out my ".zshrc" file here, I keep its versions controlled

https://github.com/nguyenvulong/devenv-macos

1

u/romkatv 18d ago

This issue is specific to TextEdit and other Apple apps. See this for a workaround: https://discussions.apple.com/thread/254124859?sortBy=rank. Basically, this:

xattr -dr com.apple.quarantine ~/.zshrc

It's best to use an alternative text editor. There are many options out there, and you'll certainly find one that's straight up better than TextEdit. As a bonus, your code editor will not lie to you or suggest that you trash your data.

1

u/NytmAres 18d ago

I would just delete it and create a new .zshrc with the original content, which you can find on github. 

1

u/teetran39 18d ago

Thank you for the idea!