# GFW fails with ST3 on Windows 11

5 messages from 2023-10-27 to 2023-10-27. Participants: John, brian m. carlson, Konstantin Khomoutov.
Thread: https://gitlist.dev/t/60436

## John, 2023-10-27 07:31

Subject: GFW fails with ST3 on Windows 11
Message-ID: <cd248c66-fc71-4783-9195-02c8811744b8@app.fastmail.com>
URL: https://gitlist.dev/e/cd248c66-fc71-4783-9195-02c8811744b8%40app.fastmail.com

```
I have been using Sublime Text 3 as the editor on Git for Windows for years, on Windows 10. I recently purchased a Windows 11 machine. On that machine, when I give GFW the following command, I get the response shown:

$ git commit -a
[…]
hint: Waiting for your editor to close the file… C:\Program Files\Sublime Text 3\sublime_text.exe: C:Program: command not found
error: There was a problem with the editor ‘C:\Program Files\Sublime Text 3\sublime_text.exe’.
Please supply the message using either -m or -F option.

Does anyone know of a fix? To repeat, it’s only a problem on Windows 11.

```

## brian m. carlson, 2023-10-27 09:25

Subject: Re: GFW fails with ST3 on Windows 11
Message-ID: <ZTuCHVwAhAGJcQDd@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/ZTuCHVwAhAGJcQDd%40tapette.crustytoothpaste.net
In-Reply-To: <cd248c66-fc71-4783-9195-02c8811744b8@app.fastmail.com>

```
On 2023-10-27 at 07:31:32, John wrote:
> I have been using Sublime Text 3 as the editor on Git for Windows for years, on Windows 10. I recently purchased a Windows 11 machine. On that machine, when I give GFW the following command, I get the response shown:
> 
> $ git commit -a
> […]
> hint: Waiting for your editor to close the file… C:\Program Files\Sublime Text 3\sublime_text.exe: C:Program: command not found
> error: There was a problem with the editor ‘C:\Program Files\Sublime Text 3\sublime_text.exe’.
> Please supply the message using either -m or -F option.

I think the "command not found" indicates that you may have specified
your editor incorrectly.  In Git Bash, can you try the following
commands, one at a time, and then commit between each one to see if one
of them works?

  git config --global core.editor '"C:/Program Files/Sublime Text 3/sublime_text.exe"'
  git config --global core.editor '"C:\Program Files\Sublime Text 3\sublime_text.exe"'

I believe that both should work here.

My guess is that this is the situation hinted at in the FAQ[0], where,
because the editor is passed to the shell (bash), you need to use double
quotes to prevent it from thinking that you have a program named
"C:\Program" with arguments "Files\Sublime", "Text", and
"3\sublime_text.exe".

Hopefully this works; if not, please let us know, and hopefully someone
on the list who uses Windows can provide some help.  I'm afraid that, as
a Linux user, I'm not able to provide more than a guess here.

[0] https://git-scm.com/docs/gitfaq#configure-editor
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

```

## brian m. carlson, 2023-10-27 11:24

Subject: Re: GFW fails with ST3 on Windows 11
Message-ID: <ZTud8HxDxK1UgLCR@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/ZTud8HxDxK1UgLCR%40tapette.crustytoothpaste.net
In-Reply-To: <e1de1948-8604-4c8f-961b-d214efa4ed84@app.fastmail.com>

```
On 2023-10-27 at 09:59:47, John wrote:
> Brian,
> 
> Thanks very much for your suggestions. Unfortunately, after each command, I continue to get the same error messages noted in my original email.
> 
> Any Windows 11 experts out there--please help.
> 
> John
> 
> On Fri, 27 Oct 2023, at 16:25, brian m. carlson wrote:
> > On 2023-10-27 at 07:31:32, John wrote:
> >> I have been using Sublime Text 3 as the editor on Git for Windows for years, on Windows 10. I recently purchased a Windows 11 machine. On that machine, when I give GFW the following command, I get the response shown:
> >> 
> >> $ git commit -a
> >> […]
> >> hint: Waiting for your editor to close the file… C:\Program Files\Sublime Text 3\sublime_text.exe: C:Program: command not found
> >> error: There was a problem with the editor ‘C:\Program Files\Sublime Text 3\sublime_text.exe’.
> >> Please supply the message using either -m or -F option.
> >
> > I think the "command not found" indicates that you may have specified
> > your editor incorrectly.  In Git Bash, can you try the following
> > commands, one at a time, and then commit between each one to see if one
> > of them works?
> >
> >   git config --global core.editor '"C:/Program Files/Sublime Text 
> > 3/sublime_text.exe"'
> >   git config --global core.editor '"C:\Program Files\Sublime Text 
> > 3\sublime_text.exe"'
> >
> > I believe that both should work here.
> >
> > My guess is that this is the situation hinted at in the FAQ[0], where,
> > because the editor is passed to the shell (bash), you need to use double
> > quotes to prevent it from thinking that you have a program named
> > "C:\Program" with arguments "Files\Sublime", "Text", and
> > "3\sublime_text.exe".
> >
> > Hopefully this works; if not, please let us know, and hopefully someone
> > on the list who uses Windows can provide some help.  I'm afraid that, as
> > a Linux user, I'm not able to provide more than a guess here.
> >
> > [0] https://git-scm.com/docs/gitfaq#configure-editor

It looks like this was sent to just me and not the list, so forwarding
it back for additional assistance.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

```

## Konstantin Khomoutov, 2023-10-27 12:29

Subject: Re: GFW fails with ST3 on Windows 11
Message-ID: <20231027122957.6mb6vyrqhnlwit6q@carbon>
URL: https://gitlist.dev/e/20231027122957.6mb6vyrqhnlwit6q%40carbon
In-Reply-To: <cd248c66-fc71-4783-9195-02c8811744b8@app.fastmail.com>

```
On Fri, Oct 27, 2023 at 02:31:32PM +0700, John wrote:

> I have been using Sublime Text 3 as the editor on Git for Windows for years,
> on Windows 10. I recently purchased a Windows 11 machine. On that machine,
> when I give GFW the following command, I get the response shown:
> 
> $ git commit -a
> […]
> hint: Waiting for your editor to close the file… C:\Program Files\Sublime Text 3\sublime_text.exe: C:Program: command not found
> error: There was a problem with the editor ‘C:\Program Files\Sublime Text 3\sublime_text.exe’.
> Please supply the message using either -m or -F option.
> 
> Does anyone know of a fix? To repeat, it’s only a problem on Windows 11.

What if you change the contents of the GIT_EDITOR (or EDITOR - whichever is
set) environment variable to contain forward slashes? That is, for the
pathname to read "C:/Program Files/..."?

If that does not work, what if you replace "C:/" with "/c/" - that is, for the
pathname to read "/c/Program files/..."?

Please note that depending on where this variable is set (in the "System"
block of setting or "User") you might need to reboot or relogin,
correspondingly in order for the setting to be applied to your environment.

Also please check the core.editor configuration setting - it might be set,
and then you should try to modify it instead [3].

While we're at it, such issues are better discussed on the dedicated mailing
list for GfW [1]. Also check the project's issue tracker [2].

 1. https://groups.google.com/g/git-for-windows/
 2. https://github.com/git-for-windows/git/issues/
 3. https://github.com/git-for-windows/git/issues/782


```

## Konstantin Khomoutov, 2023-10-27 12:37

Subject: Re: GFW fails with ST3 on Windows 11
Message-ID: <20231027123734.x4ziimecgj6isfsa@carbon>
URL: https://gitlist.dev/e/20231027123734.x4ziimecgj6isfsa%40carbon
In-Reply-To: <cd248c66-fc71-4783-9195-02c8811744b8@app.fastmail.com>

```
On Fri, Oct 27, 2023 at 03:29:58PM +0300, Konstantin Khomoutov wrote:

[...]
> Also please check the core.editor configuration setting - it might be set,
> and then you should try to modify it instead.
[...]

This means Git's configuration setting.

You might run

  git config --get-all --show-scope core.editor

in your shell to get the values of this setting printed, if set, prefixed with
the scope these values are defined in (see `git help config` or [1] for more
info).

 1. https://www.git-scm.com/docs/git-config


```
