Git: Feature: Support "windows terminal" in addition to mintty and cmd

Created on 12 May 2020  路  10Comments  路  Source: git-for-windows/git

When installing I'm presented with the option to use either mintty or cmd with git bash. Windows terminal would be a good option to add going forward as it is officially supported by Microsoft, but is not... like cmd.

enhancement up for grabs

All 10 comments

I like the idea, but there are challenges with it:

  • We cannot bundle Windows Terminal, so we'd have to somehow detect its presence
  • Last time I checked, there were some funny issues when resizing the window, and that's when I stopped checking whether Windows Terminal is compatible with Git for Windows. Admittedly, this has been a long time ago.
  • The Git for Windows project is not really in need of more feature requests, but in need of more contributors taking care of such feature requests. I really hope that you turn out to be such a contributor.

In short: I would be delighted to assist you in your endeavors to make this happen.

It's a windows store app so if the user selects that option it should be fairly straightforward to automatically install that.

It's a windows store app so if the user selects that option it should be fairly straightforward to automatically install that.

Yep. Go right ahead implementing that.

This would be a great feature. I already use git bash with windows terminal, but I cannot get it to work in the xterm-256color mode. I cannot understand why, since git bash works in mintty with this mode, and for example cygwin bash works in windows terminal with this mode too.

@lhotamir so how about helping out? This feature request won't implement itself...

Just for reference:

https://docs.microsoft.com/en-us/windows/terminal/command-line-arguments

wt.exe is made available in the PATH when installed, for me it's located at %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe

It seems to always open a new window, rather than adding a tab to an existing one. I tried resource hacking the git-bash.exe command string (still using usr/bin/bash.exe), which launched it ok, but the environment variables weren't set correctly, e.g. MSYSTEM. They are set when using bin/bash.exe instead however.

On the Windows Terminal side there's an effort to allow third party programs to add/modify profiles, which might be useful in the future: https://github.com/microsoft/terminal/blob/main/doc/specs/Proto%20extensions-spec.md

There's also a request to add a profile for Git Bash by default if it's installed, similar to what already happens with WSL: microsoft/terminal#1394

I suggest in Git installer, add a checkbox add Git to Windows terminal and append the new entry to Windows Terminal profiles.json

The last time I added G4w bash to Windows Terminal, it mostly worked, but not everything. Anyway, it was enough that I opted to remove it from Windows Terminal and keep using mintty.

Unless something has significantly changed, I think maybe this shouldn't be part of the official G4w installer, as it may become a steady source of issues which will become a distraction to the g4w team.

At most, I might provide instructions on the Readme for adding g4w to the Windows Terminal with a disclaimer that g4w will not support any issues from running it in Windows Terminal.

I'll just say that Windows Terminal has been steadily improving, and it's intended to eventually supersede conhost as the default terminal on Windows. I think as time progresses you'll see more people looking for a quick/easy way to use Git Bash with it, even if it's just silently providing a profile on install if/when that RFC that I linked above comes to fruition.

@noinkling I am definitely not opposed to including this as an experimental feature in the Git for Windows installer. It's just that _somebody_ has to do the work, and that somebody isn't me. If that somebody is you, here are a couple of pointers:

Feel free to ask questions!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vocaviking picture vocaviking  路  5Comments

limasued picture limasued  路  3Comments

Jarmos-san picture Jarmos-san  路  3Comments

educhana picture educhana  路  5Comments

kc22033 picture kc22033  路  4Comments