Live data from Hacker News

Sublime text started adding a “.s” to new files

forum.sublimetext.com

1–10 of 138 posts

Re: Sublime text started adding a “.s” to new files

#6

I don't understand. What adding ".s" to the file name is supposed to correct?

I'm not convinced it's ".s". Of the two examples (2nd is the GitHub link in TFA), both file name extensions start with "s". Ergo, the OS dialog is doing file_name_extension.substring(0,1), perhaps?

Still on Sonoma, or I would answer this question myself.

Re: Sublime text started adding a “.s” to new files

#7
My guess, having never used OSX:

1. In the save dialog, filetype can determined in multiple ways (maybe selected from a dropdown, or be set by the program opening the dialog) and not necessarily just inferred from user-entered filename

2. So when returning the path to the program, it appends the filetype's extension to the path iff it doesn't already end in it (so user can enter just `notes` and file gets saved as `notes.txt`, if that was selected in the dropdown or the program's default)

3. Probably unintentionally, they've started allowing partial matches when inferring filetype from the user-entered filename

e.g: User enters `database.sql`, it matches against `.s` extension of assembly filetype, but `database.sql` doesn't end in `.s` so becomes `database.sql.s`

Re: Sublime text started adding a “.s” to new files

#8

Who thought this was a good idea? Is there any actual documentation on this or is it just a thing they added?

Isn’t this almost certainly a bug? I’m pretty sure the MacOS developers don’t really want to add a .s extension to files.

Re: Sublime text started adding a “.s” to new files

#10

In the Save File As dialog of most Windows apps, you can enclose the filename in double-quotes to force it to not add an extension. I wonder if that will help with the issue in macOS?

No, macOS will just put quotes in the name. I just saved file from vscode as "testfile.sql", including the quotes, and wound up with a file named "testfile.sql".s.
Post reply on HN