Sublime Forum

"subl -w" on Windows doesn't return back to Git when used as default editor

#1

Hey guys, I’m seeing this issue sporadically on Windows 10.

I’m using PowerShell (running as Administrator) with git version 2.21.0.and Sublime Text 3 3.2.1, Build 3207.

My Git configuration is as follows:

[core]
    editor = subl.exe -w

Sublime Text 3 (C:\Program Files\Sublime Text 3) is added to my PATH.

The problem occurs quite often when I’m running git commit --amend, I complete my edits and close and save the tab in Sublime Text, yet the console is stuck waiting:

e.g.

PS C:\Users\fots\OneDrive\Development\lunette> git commit --amend
hint: Waiting for your editor to close the file...

When looking in Task Manager, I can see the subl.exe process is still sitting there along with sublime_text.exe.

I can also reproduce this simply with a command such as;

subl -w test.txt

Once completely restarting Sublime Text, it works well for a while, until it happens again.

I have reproduced this on a completely vanilla install with no extra packages or custom preferences / key bindings.

The steps seem to be:

  1. Open Sublime Text 3 (without admin rights)
  2. Run “subl -w test.txt” in an Administrator PowerShell console
  3. Add some text and save and close the file
  4. Notice that the command doesn’t return

It works fine if Sublime Text isn’t open already (maybe because at that point, Sublime Text is open with admin rights by PowerShell). It also seems to work if you’re not in an administrator console.

Any help is greatly greatly appreciated
Fotis

0 Likes

#2

Did you try the following?

[core]
    editor = subl.exe -n -w

By creating a new window ST should return control after closing it, even though ST is already running.

This is how I did id until Sublime Merge was invented.

0 Likes

#3

Thanks a lot for the reply. I did actually try this but sadly that didn’t help.

0 Likes

#4

see the comments at

1 Like

#5

Ah yep, this looks exactly like my issue. I’ll get involved in the discussion on GitHub.

Thanks heaps for your help
Fotis

0 Likes