Sublime Forum

Safe Mode when run from AutoHotKey

#1

Hello and thank you in advance!

I upgraded to ST4. My AutoHotkey (AHK) script to open ST is now opening ST in safe mode.

When I open cmd.exe normally and run "C:\Program Files\Sublime Text\sublime_text.exe" it opens normally as expected.
When I run it from AHK using Run, "C:\Program Files\Sublime Text\sublime_text.exe" it opens in safe mode.

I have also tried Run, %ComSpec% /c ""C:\Program Files\Sublime Text\sublime_text.exe"" which opens a cmd.exe window that runs sublime text.
I have tried uninstalling and re-installing ST4.

I realize that this is highly AHK related, however, this most likely is a problem with sublime text because it was working fine with ST3 and does not seem like the expected behavior for ST4. There might be some hidden parameters in AHK’s Run command, but I can’t find any. It seems like ST should only be opening in safe mode if the command line argument is passed.

  1. Do you know why this is happening?
  2. Is there a way I can debug why this is happening?
  3. Is ST detecting the user/permissions running sublime_text.exe?
  4. How does ST know it’s being run from a different source?
0 Likes

#2

I was wrong, this is not a problem with ST. It is happening because Safe Mode is triggered if ST is opened while holding Alt. Alt was part of my hotkey, so it was held at the time it is open.


I would like to add to the request of being able to change the safe mode key.

For now, I was able to fix this by adding KeyWait, Alt before Run so it waits until the Alt key is lifted before opening ST. It now opens normally. Even better, use Send, {Blind}{Alt up} before running.

0 Likes