-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
windows output is formatted incorrectly after a clone is performed #4856
Comments
@bchadwic Thanks for looking into this!
That seems to be a fair assessment. However, they shouldn't "fight" over IO in a concurrent manner, since we always wait for Note that both Survey and git clone tend to use the Also note that on Windows we wrap stdout & stderr streams with cli/pkg/iostreams/iostreams.go Lines 380 to 381 in 7e7735d
git clone commands gets access to the original (unmodified) stdout/stderr streams via os.Stdout and os.Stderr . Maybe the inconsistency is between these two types of streams (wrapped vs. unwrapped)?
|
Thank you for the leads! I hate to throw this back in your court, but I'd like to hear your thoughts on this: In hopes to easily pinpoint the problem, I crudely copied and simplified the code that makes up https://github.com/bchadwic/cli/blob/example/cmd/gh/main.go?plain=1#L53-L81 To be sure, I ran my custom binary vs my installed version a couple times and the problem persisted only for the vanilla Maybe it's time I learn how to use delve, in the meantime let me know if you have any thoughts! |
I think your approach of isolating the problem is sound. FWIW, the green check worked for me fine after regular I don't think using a debugger is going to necessarily help here. I would double down on recreating a minimal reproduction case, ideally divorced from regular gh/git/network functionality so that you can keep re-running it indiscriminately and without consequences. I'm open to pairing on this one of your mornings this week. |
Because of this, I installed gh and git on a new user on my machine. Oddly, the new user printed the check just fine. I then decided to test the combination of each user vs each installed gh using their absolute paths: logged in...
Is it possible, even after uninstalling / reinstalling git any non system setting could've persisted that would do something like this?
I'd love to find the root of this mystery, but I'd hate for you to spend time tracking down an issue that affects only one user profile on one machine. Feel free to close this issue if this finding renders this issue out of the cli's wheelhouse |
Hmm, I don't know how to explain the fact that you're seeing different output when logged in with a different user 😕 You're right, maybe this issue is too obscure/intermittent for us to spend time doing a deep dive on, but as a stab in the dark, I do think that stopping using |
Agreed, I stopped sourcing the problem for now. If I see anything else out of place with related output, I'll report back. |
Describe the bug
When
gh repo clone
orgh repo fork
clones a repository, the output after the clone progress is uninterpretable when styledSteps to reproduce the behavior
On Windows, using powershell or cmd.exe (inside or outside of Windows Terminal), run
gh repo fork cli/cli
I originally discovered this using v2.3.0, but I downgraded to see if the release reminder would be affected as well and it is:
Expected vs actual behavior
expected behavior is to display the colored / styled text properly. It doesn't seem like it could be my terminal because I can run other commands that use colors / styles just fine.
Additional Thoughts
Also the majority of the time I use this command, git and gh seem like they are fighting over the io:
I think it might have something to do with this:
https://github.com/cli/cli/blob/trunk/git/git.go?plain=1#L353-L355
especially since it affects
gh repo clone
andgh repo fork
:Maybe there is a more graceful way to pass the output between git and gh so that both these issues can be resolved.
I'll start working on a pr 🤷♂️
The text was updated successfully, but these errors were encountered: