Repository navigation
Git dumb terminal - #8962
Merged
Merged
Git dumb terminal#8962
Conversation
In between Git 2.22.1[1] and 2.24.0[2] Git attempted to use a different method of clearing the last line in the terminal for non-dumb terminals. While that change was reverted in 2.24 we're currently on 2.23 and have to deal with it. The side effects of this for us is that our progress parsing has stopped working and that Git error messages are littered with lines starting with "[K" which at best will be confusing to users. Setting TERM to 'dumb' effectively reverts the behavior to what we're used to (see https://github.com/git/git/blob/a7312d1a28ff3ab0a5a5427b35f01d943103cba8/editor.c#L11-L15). 1. git/git@5b12e31#diff-cf9e2e00bf41dfd6ab5e3e60149405dd 2. git/git@bbf4756#diff-cf9e2e00bf41dfd6ab5e3e60149405dd
outofambit
approved these changes
Jan 23, 2020
niik
added a commit
that referenced
this pull request
Jan 29, 2020
On Windows we apparently have to explicitly set it to 'dumb' for the is_terminal_dumb check to return true. See #8962
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TL;DR: Our update to Git 2.23 broke our progress parsing
While testing yesterday's beta release I noticed that progress bars in the app didn't seem to behave normally and spotted some odd characters in the description text.
This
[Kprefix comes from a change made in Git 2.22.1 which was reverted in Git 2.24.0. Unfortunately we (I) up and decided to upgrade us to Git 2.23 a while back so now we have to deal with this.The behavior requires that the
TERMenvironment variable is set which, if you launch GitHub Desktop from the terminal (using thegithub .CLI command which I frequently do) as I frequently do, it will be.As luck would have it the workaround is pretty straightforward. We can unset the TERM environment variable in order to make the
is_terminal_dumb()method in Git return true and thereby reverting us to (almost) the same behavior as we had in 2.19.This is a prudent change regardless of Git version so we should keep this once we upgrade to 2.24+.
I am unfortunately under the impression that given that this is a regression which we haven't shipped to prod yet we should attempt to land this ahead of the next production release.
Testing notes
githuboropen -a "GitHub Desktop"[K.Release notes
Notes: [Fixed] Progress bars failed to update properly when Desktop was launched from a terminal.