Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw: set $env:TERM=xterm-256color for newer OSes #3751

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

rkitover
Copy link

@rkitover rkitover commented Mar 22, 2022

@dscho @phil-blain @rimrul

Hi guys, this is half of my fix for #3629.

Once this is done I will try to fix quoting/escaping in $env:EDITOR which was the other problem there.

@rkitover rkitover force-pushed the native-term branch 2 times, most recently from 04c635b to 528ed92 Compare March 22, 2022 13:48
@rkitover
Copy link
Author

@dscho Hey, can you trigger the CI again please, it's giving me a fail on old code.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is a good start, I left a couple of suggestions how I think this PR could be improved, still.

compat/mingw.c Outdated Show resolved Hide resolved
compat/mingw.c Outdated Show resolved Hide resolved
compat/mingw.c Outdated Show resolved Hide resolved
@rkitover rkitover force-pushed the native-term branch 9 times, most recently from 4dbb2fc to f634351 Compare March 25, 2022 20:13
@rkitover
Copy link
Author

@dscho In the interests of getting this fix out, I used your method, we can revisit the build number issue later.

@rkitover
Copy link
Author

I tested this and it does work with the manifest.

@phil-blain
Copy link

phil-blain commented Apr 12, 2022

Hi @rkitover, you misspelled my username in your PR description, so I just saw this :)

I think the fix makes sense: cmd and PowerShell do not set TERM , so with this change we will get xterm-256color, whereas if it's already set by the terminal / git wrapper / something else it will stay as-is.

For completeness, you could mention the history of this part of the code, linking the commits mentioned in #3629, but I don't think it's necessary.

Small nit: I would capitalize "Windows" in the commit message.

For Windows builds >= 15063 set $env:TERM to "xterm-256color" instead of
"cygwin" because they have a more capable console system that supports
this. Also set $env:COLORTERM="truecolor" if unset.

$env:TERM is initialized so that ANSI colors in color.c work, see
29a3963 (Win32: patch Windows environment on startup, 2012-01-15).

See git-for-windows#3629 regarding problems caused by always setting
$env:TERM="cygwin".

This is the same heuristic used by the Cygwin runtime.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
@rkitover
Copy link
Author

@phil-blain I've made these changes.

@rkitover
Copy link
Author

@dscho Any objections to merging this as-is? This is literally your code, and the manifest issue is unrelated, this will work fine in the normal MINGW builds, I will try to deal with the manifest for VS builds later in a separate PR.

Offtopic, on the other PR, I will make the changes as per your preferences as I've said, I've been distracted the past couple of weeks with feeling horrible and working on an issue in another project, but I will switch to this now.

@dscho dscho merged commit 24f4e77 into git-for-windows:main Apr 21, 2022
@dscho
Copy link
Member

dscho commented Apr 21, 2022

Thank you! And please forgive me that I could not take care of this PR sooner.

dscho added a commit to git-for-windows/build-extra that referenced this pull request Apr 21, 2022
On newer Windows versions, Git [now
assumes a Win32 Console with full color
capabilities](git-for-windows/git#3751). This
helps e.g. when NeoVIM is configured as Git's editor.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Apr 26, 2022
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Apr 26, 2022
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Apr 26, 2022
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Apr 26, 2022
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Oct 11, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Oct 20, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Oct 20, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Oct 21, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 21, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 21, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Oct 23, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Oct 30, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Nov 1, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Nov 6, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Nov 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Nov 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Nov 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Nov 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit that referenced this pull request Nov 22, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
dscho added a commit to dscho/git that referenced this pull request Nov 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
mingw: set $env:TERM=xterm-256color for newer OSes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants