Sublime Forum

Sublime opens a new empty window for .c files



I have noticed that on Sublime Build 4155 on Windows 10 22H2 (Build 19045.3393), whenever I double-click a C source file (any file with .c extension), even though it opens Sublime (as I have set it as the default program for this extension) it does not open any file at all. What it shows is a new empty Sublime window with no open files.

Instead, if I right-click on the file > Open with Sublime Text, the file opens fine.

I have tried deleting the registry entry for the .c file association (then restart PC) and changing the association via Windows Settings. After setting the file association back to Sublime Text, the issue is not fixed.

The issue does not happen with any other extension (.cpp, .txt, …) but only with .c files.

The issue does not happen if I set Notepad++ to be the default association.

Any ideas on whether this is a Sublime or Windows issue and how to solve it?

Thanks in advance.



I was able to resolve this.

Solution: In Registry, change value of:


to be:

C:\Program Files\Sublime Text\sublime_text.exe "%1"

Before the change it was:

C:\Program Files\Sublime Text\sublime_text.exe ""

It is still unclear how it could still open other file extensions even if the %1 (placeholder for the file path) was not there but I will keep the change for now and see if it causes any other issues.

Links: here, here, and here.

This was most likely a Windows 10 issue.



I had this issue with ST 3 on Win11, but it was with .txt extensions; still a text file which I presume .c files are as well. I deleted the reg entry and recreated the association. Does this confirm it as an OS issue?



Thanks for the alternative solution. My speculation is that it’s an OS issue but I cannot say for sure.

Does the registry entry on your end have the “%1” for the file path or not?