Friday, November 15, 2024

macos – Why does my file endings automatically get corrected and how can I disable it?

I’m not sure if this is a beta feature. I’m on Sequoia 15.1 right now which is the beta version, but maybe that feature is older and I’ve just never noticed it.

Whenever I try to save a file with a e.g. a text editor, and it uses the standard macOS file saving dialog, it autocorrects my file endings without asking me. For example, if I name the file .pngg and click on save, it will be saved as .pngg.png. This is totally stupid and also annoying because it doesn’t actually “knows” all file endings. For example, I wanted to save an SQL script, so I named it .sql, and my Mac made it .sql.s.

If you want to try to reproduce:

  • Grab your favorite text editor (I tested it with Sublime Text, Zed and TextEdit)
  • You need to make sure your app uses the standard macOS dialog to save files and does not require a specific file ending. For example, when just opening a new file in Sublime Text and saving it, this worked, but when I choose e.g. Python syntax, macOS will always add .py to your file and doesn’t tries to autocorrect it
  • If you’re using TextEdit, Format > Make it plain text, and uncheck the .txt checkbox in the file dialog
  • Now create an empty, save it and name it something with a fucked up filename, like .txtx which clearly doesn’t exist but is similar to .txt, or .exea which will become .exe and so on.
  • Click on save it look at your filename now.

I can’t tell if this is a feature from the beta or a bug.

How can I prevent this and get files saved exactly how I name them?

Related Articles

Latest Articles