Tapatalk

How do I get UES to seamlessly work with git bash shell on Windows?

How do I get UES to seamlessly work with git bash shell on Windows?

12
Basic UserBasic User
12

PostDec 10, 2025#1

Using Windows 10 with extended support, so I assume I'm up to date.
I'm using the latest version of git (git version 2.52.0.windows.1)

If I have git integration enabled, everything seems to work except...
  1. If I try to execute `git commit` without the -m "message", a blank UEStudio instances opens, and need to manually navigate to the correct file, edit it and close it.  
    How should the editor= line in .gitconfig read so that the correct file is opened automatically?  I can use a wrapper script, but that seems like a kludge.
    Yes, I can right-click the file and commit it from the file explorer pane, but that leads us to point 
  2. When I open UES, the file explorer window doesn't point to the current project directory, but rather just shows what ever was there last time.  When I do navigate to the project folder to commit the file I just modified, there's a lot of scrolling to be done to find the file to commit, which is why I just type `git commit` in the git bash shell.  
Suggestion:
Add a setting so that the file explorer syncs to the folder of the open file.  

Regards,
—Meroveus

6,824625
Grand MasterGrand Master
6,824625

PostDec 10, 2025#2

Open in UEStudio Advanced - Settings or Configuration - Integrated applications - Version Control Systems - Git and check Enable Git integration and next Set UEStudio as default editor for all repositories. The second setting adds/replaces in file .gitconfig in the directory %UserProfile% the configuration setting for editor= correct for using UEStudio as editor by git. This setting can be moved from the user's Git configuration file to the project/repository Git configuration file if you do not want UEStudio as default editor for all repositories.

12
Basic UserBasic User
12

PostDec 11, 2025#3

When I do this, UEStudio opens with a new blank window.
On the other hand, if I use the default entry in .gitconfig

Code: Select all

editor="'C:/Windows/System32/notepad.exe'"
Notepad opens with the required file already open – I just edit it, save it, and when I close Notepad I'm done.
This does not happen if the .gitconfig line is:

Code: Select all

editor="'C:/Program Files/IDM Computer Solutions/UEStudio/UEStudio.exe'"
I've tried adding /fni in various places but with no joy.

What am I missing?
What are the other benefits of adding UEStudio as the default editor, if it doesn't do that single task?  

What does your .gitconfig editor line look like?

6,824625
Grand MasterGrand Master
6,824625

PostDec 12, 2025#4

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:

Code: Select all

@echo/
@echo %0 %*
@pause
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:
  1. 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%
  2. Uncheck in configuration of UEStudio the setting Set UEStudio as default editor for all repositories.
  3. 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.

12
Basic UserBasic User
12

PostDec 12, 2025#5

Thanks,
I had already created the wrapper script.
Mine is:

Code: Select all

@echo off
log32 %0 %* >> d:\tempx\git-editor.log
rem %1 is the file Git wants edited (e.g. .git\COMMIT_EDITMSG)
set "target=%1"
rem Expand to a full path (optional but often helps)
for %%F in ("%target%") do set "target=%%~fF"

log32 target=%target% >> d:\tempx\git-editor.log
FOR /F "tokens=*" %%k IN ('git config --global core.editor') DO SET editor=%%k
log32 Editor is '%editor%' >> d:\tempx\git-editor.log

rem Call UEStudio with the full path
log32 run UEStudio on %target% >> d:\tempx\git-editor.log
"C:\Program Files\IDM Computer Solutions\UEStudio\UEStudio.exe" /fni "%target%"
FOR /F "tokens=*" %%k IN ('git config --global core.editor') DO SET editor=%%k
log32 Editor is '%editor%' >> d:\tempx\git-editor.log
git config --global core.editor d:/tools/gitEdit.bat
FOR /F "tokens=*" %%k IN ('git config --global core.editor') DO SET editor=%%k
log32 Editor is '%editor%' >> d:\tempx\git-editor.log

log32 end run >> d:\tempx\git-editor.log
log32 is a helper app that outputs the local time followed by any arguments.  All the extra logging was to try to figure out what was happening.
It is massive overkill, but it does work.

6,824625
Grand MasterGrand Master
6,824625

PostDec 13, 2025#6

I read git config documentation and git commit documentation and searched the world wide web but could not find any information on how to get Git on Windows to pass the file name of the git commit message text file either with backslash instead of slash as directory separator or at least always enclosed in double quotes to the started editor executable.

There can be used with UEStudio / UltraEdit 2025.1.0.20 only a workaround solution running a script file which modifies the file name argument string into a suitable format for being correct interpreted by UEStudio / UltraEdit.

The issue with not interpreting an argument string like D:/PROJECTS/TEST/.git/COMMIT_EDITMSG as file name argument string despite wrong directory separator and on not being enclosed in double quotes should be really reported by email to the support of UltraEdit, Inc. Edit: I have reported this issue by email to UltraEdit support.

Starting UltraEdit / UEStudio with such a file name string on the command line worked according to my tests up to UltraEdit v27.10.0.164 and UEStudio v20.10.0.58 released December 2020. Such a file name argument string is not interpreted correct anymore since UltraEdit v28.00.0.46 and UEStudio v21.00.0.7 released March 2021 up to currently latest UltraEdit / UEStudio 2025.1.0.20 (UE v31.1.0.20 and UES v25.1.0.20 in former version numbering scheme). That could be an important fact for the UE/UES developers.

I thought that the cause of the file name argument string parsing issue could be the feature of UE/UES being started with a file name with a line and perhaps even a column number specified on the command line like C:\PROGRA~1\IDMCOM~2\UEStudio\CHANGE~1.TXT/20/18 or "C:\Program Files\IDM Computer Solutions\UEStudio\changes_ues.txt/20/18" for opening the specified file and put the caret at line 20 column 18.

The help page Command Line Parameters explains that feature as follows:
"UE/UES help wrote:To specify the line and column number at which to position the cursor when the file is opened, the line number and column number should follow the filename immediately separated from the filename by a '/' character follows:

filename/5/2        This opens the file with the cursor positioned at line 5, column 2.  The line number may be specified without specifying the column number.

The separator character '/' was a comma in previous releases, however as this is a valid character for filenames it has been changed.  If it is preferred to use the comma or another character, the following line may be added to the INI file:

LineColumnChar= ,

where the comma may be any character except a colon ':', however UltraEdit will not be able to open a file that contains this character.
I modified ues.ini with UltraEdit while no instance of UEStudio was running by adding in the section [Settings] the setting LineColumnChar=| and saving with closing the file in UltraEdit. Then I tested if that setting modification works by running:

Code: Select all

"C:\Program Files\IDM Computer Solutions\UEStudio\uestudio.exe" "C:\Program Files\IDM Computer Solutions\UEStudio\changes_ues.txt|20|18"
That worked fine. But running UEStudio with D:/PROJECTS/TEST/.git/COMMIT_EDITMSG as argument string was still not working despite LineColumnChar=| in section [Settings] in %APPDATA%\IDMComp\UEStudio\ues.ini. However, it was worth a try.