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

GPG git commit - AllowSetForegroundWindow - Access is Denied #3017

Closed
ElectricHavoc opened this issue Oct 1, 2019 · 4 comments
Closed

GPG git commit - AllowSetForegroundWindow - Access is Denied #3017

ElectricHavoc opened this issue Oct 1, 2019 · 4 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.

Comments

@ElectricHavoc
Copy link

While watching the great @shanselman show off his shiny new terminal in dotnet community standup, we encountered an interesting use case. I've included the clip below.

Environment

Scott Hanselman's DotNet Machine

Steps to reproduce

Using gpg to sign commits, it throws an access denied error.

https://clips.twitch.tv/EsteemedColorfulVelociraptorSoBayed

Expected behavior

Some expected output shown from gpg in colors?

Actual behavior

gpg: AllowSetForegroundWindow(#) failed: Access is denied.

image

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Oct 1, 2019
@zadjii-msft
Copy link
Member

@shanselman why is this a Windows Terminal bug?

What's the real "expected behavior" here?

My totally uneducated guess is that gpg is using GetConsoleWindow to try and pop a dialog above the console window? Though, that's one of those APIs that we're just discouraging people from using, especially in ConPTY. #2988 is having a very similar discussion currently. I might be totally off base here.

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. labels Oct 1, 2019
@shanselman
Copy link
Member

@zadjii-msft It's a terminal bug because it works today in conhost/cmd.exe ;) It's a regression from "it worked before and now I use Terminal and it doesn't work." It's a pretty interesting bug.

To be clear, it literally makes signed git commits impossible with Windows Terminal. We can take it up with gpg but it's still a problem. If it's a Bad Thing (TM) then we could provide them with an example of the Right Way.

@zadjii-msft
Copy link
Member

Oh I'm more worried about the why it's a bug.

Does anyone know the right place to report this upstream?

We've already dealt with an issue like this, where msys2 tools where using GetConsoleWindow to check if the console was running in a headless/headed scenario. Previously, conpty just returned 0, which made them think they were running headless, and changed their behavior. So we created a fake HWND for them to be able to use.

@shanselman Out of curiosity, does this repro if you try running the same command in cmd.exe/powershell.exe/pwsh.exe from within WSL? Running those Windows exe's from w/in WSL will activate conpty mode with conhost.exe as the Terminal. If it does repro there, then we can be sure it's a conpty bug, and not (somehow) a Terminal bug.

@zadjii-msft zadjii-msft removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Oct 2, 2019
@zadjii-msft
Copy link
Member

Hey so @shanselman and I spoke on the phone recently, and we actually couldn't repro this again 😆

Considering the breadth of issues posted elsewhere on the web that pre-date the Terminal, it seems like this particular error message is actually unrelated to the Terminal after all.

Thanks for the bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants