Git should run
"C:
/Program Files
/IDM Computer Solutions
/UEStudio
/UEStudio.exe
" or more correct on Windows
"C:
\Program Files
\IDM Computer Solutions
\UEStudio
\UEStudio.exe
" with the fully qualified file name of the file to edit also enclosed in
" appended as first argument. That should be done by
Git with any editor executable specified in the
Git configuration file. It should not matter if the
Git Bash (
bash.exe) or the
Windows Command Prompt (
cmd.exe) or a
PowerShell Console (
powershell.exe) is used by the user without or within
Windows Terminal as console.
I have not much experience with
Git but I have by chance a virtual Windows machine with an installed
Git version 2.51.2 but without UEStudio. I added to the file
.gitconfig under section
[core] the line:
Code: Select all
editor = "'C:/Program Files/IDM Computer Solutions/UEStudio/UEStudio.cmd'"
The batch file
UEStudio.cmd was next created by me in the directory
C:\Program Files\IDM Computer Solutions\UEStudio with the two lines:
That makes it possible to see how
Git runs the editor on using the
Git command
git commit -a. There is executed by
Git:
Code: Select all
"C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.bat" D:/PROJECTS/TEST/.git/COMMIT_EDITMSG
Press any key to continue . . .
Git runs the editor correct with enclosing its file name in double quotes and using backslash as directory separator. The file name of the commit message is not enclosed in double quotes which is correct in this use case as the fully qualified file name of the commit edit message text file does not contain a space or one of these characters
&()[]{}^=;!'+,`~ which otherwise would require a file name argument string enclosed in
". Interesting for me to see is that
Git uses the Linux/Mac directory separator
/ instead of the Windows directory separator
\ in the full file name of edit commit message text file. However, Microsoft describes in the documentation about
Naming Files, Paths, and Namespaces that the Windows file I/O functions replace all
/ by
\ before passing a file/folder string to the file system. The wrong directory separator does not matter for that reason for Windows itself. But the started editor must be also capable interpreting correct a file name argument string on startup with
/ instead of
\ on parsing the passed command line.
I created on my Windows machine with an installed UEStudio 2025.1.0.20 the directory
D:\PROJECTS\TEST\.git and set additionally the hidden attribute on directory
.git and copied and pasted from the virtual machine with
Git the file
COMMIT_EDITMSG into the directory on my Windows machine. I opened next a
Windows Command Prompt and executed while no other instance of UEStudio was running:
Code: Select all
"C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.exe" D:/PROJECTS/TEST/.git/COMMIT_EDITMSG
UEStudio started and displayed the error message:
UEStudio wrote:D:\ contains an incorrect path
The issue here is obviously that UEStudio as native Windows application interprets
/ as the beginning of an option like
/fni or
/i= or
/M= while Unix/Linux applications use
- as indicator for an option which is done also by most applications ported from Unix/Linux to Mac.
The command line parsing behavior of UEStudio is better on using in the
Windows Command Prompt the command line:
Code: Select all
"C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.exe" "D:/PROJECTS/TEST/.git/COMMIT_EDITMSG"
The usage of
" around the file name argument string results in UEStudio interpreting the entire file name string as one argument string despite the wrong directory separator
/ in the file name string instead of the correct directory separator
\ as it should be always used by executables written for execution on Windows.
I next tried following command line:
Code: Select all
"C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.exe" D:\PROJECTS\TEST\.git\COMMIT_EDITMSG
That worked fine. UEStudio is started and opened the text file.
So, the cause of the issue is found with
Git using wrong directory separator on Windows in the commit edit message file name and additionally not enclosing the file name in
" if it thinks that this is not necessary (no space in file name) and the command line parsing of UEStudio interpreting in this case the entire string not as one file name argument string with wrong directory separator.
How to workaround these combination of issues of
Git and UEStudio?
Well, that seems to be not simple. I found out with the batch file approach that in file
.gitconfig can be used:
Code: Select all
editor = "'C:/Program Files/IDM Computer Solutions/UEStudio/UEStudio.exe' //fni"
That results in starting UEStudio with its option
/fni as first argument string and
Git appends as second argument string the file name of the edit commit message text file.
That is good for the use case with one or more UEStudio instances are already running, but does not solve the issue with the file name string using wrong
/ and not being enclosed in
" causing a wrong interpretation of the file name string by UEStudio.
I suggest to report this issue by email to support of UltraEdit, Inc. for getting perhaps an improved parsing of the
Git command line with the file name string with wrong directory separator
/ and additionally
not enclosed in
" interpreted nevertheless by UEStudio as file name argument string which should be in my example:
D:\PROJECTS\TEST\.git\COMMIT_EDITMSG
I could not find in the Internet if it is somehow possible to force
Git to enclose all file name argument strings passed to any other executable (or script interpreted by an executable)
always in double quotes which would solve this issue too.
A workaround could be following:
- Create a batch file with name editor_ues.cmd in the directory %UserProfile% or a directory of your choice with the following lines:
Code: Select all
@echo off
set Arguments=%*
if not defined Arguments goto RunUES
set Arguments=%Arguments:/=\%
:RunUES
"C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.exe" /fni %Arguments%
- Uncheck in configuration of UEStudio the setting Set UEStudio as default editor for all repositories.
- Edit the file .gitconfig and use under section [core] the setting line:
Code: Select all
editor = "'C:/Windows/System32/cmd.exe' //D //C '%UserProfile%\\editor_ues.cmd'"
%UserProfile% should not expand to a directory path containing a space or other characters with a special meaning. Use a different directory or the short 8.3 directory path if %UserProfile% is not a simple directory path.
I could not find a better solution for this issue which does not need the execution of the
Windows Command Processor for executing a batch file which replaces all
/ by
\ in the argument strings passed by
Git to the editor executable.