You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Incorrect function" error in Windows Git Bash terminal #404
Expectation is the interactive UI to create a PR, instead there is an error message:
? Title could not collect title and/or body: could not prompt: Incorrect function.
Reacted by Chris Engstrom, Valerii Zuev, Andrei Ciuculescu, Ross Bender, Bradley Turek, Victor Pishuk, Anca Vornicu, Christopher, Marsh Macy, Andrew Varnerin and 4 more
I downloaded the latest Git (2.31.1) and the installer had a new experimental option to run 'pseudo' consoles, without requiring winpty.
I tried it out and it resolved this issue for me on Windows 10. It allowed both arrow movement and filtering. I was able to login successfully and have not had issues since.
I did not change the terminal emulator. As an aside, it also resolved my issues with running interactive Python in Git Bash.
Thanks for the hint, @ChristopherSchubert ! I just verified that that does indeed fix the issue.
As we have no control over this and it comes down to minTTY defaulting to pseudo console support, I'm going to close this issue.
For posterity, there are three workarounds for this:
Reconfigure minTTY
When installing Git For Windows, enable the pseudo console support for minTTY mentioned on this screen:
This fixes gh's prompting (as well as similar projects that do prompting).
If MinTTY is already installed, you will have to reinstall it (someone please post here if there is a way to toggle this without a reinstall).
Run with winpty
You can prefix any invocation of gh with winpty which also fixes the issue. For example:
winpty gh auth login
This could be used as an alias if need be.
Don't use MinTTY
If you want to use git+bash but aren't tied to MinTTY you can run git+bash via the new Windows Terminal (or use a third party terminal emulator like Alacritty or Hyper)
You can prefix any invocation of gh with winpty which also fixes the issue. For example:
winpty gh auth login
In my own testing, using winpty caused some subtle oddities and I wouldn't recommend it as a strong workaround. For example, I seem to recall that opening an editor within winpty gh issue create didn't focus the editor (Notepad.exe) when it was opened, and instead opened it in the background. Somebody less experienced with GitHub CLI would not have noticed that Notepad opened in the background, and will perceive the gh command as being stuck.
@mislav I think we can still mention it but call out that there might be issues (like that one). I just confirmed that running with psuedo console support enabled during installation does properly focus notepad.
Activity
mislav commentedon Feb 17, 2020
Thank you for reporting! This sounds like AlecAivazis/survey#148
l3ender commentedon Sep 24, 2020
Is there a workaround that can be used until the upstream issue is resolved?
coabr commentedon Oct 5, 2020
Have you tried to use cmd instead of bash?
tecnologer commentedon Oct 6, 2020
Yes, the error hasn't displayed if I use cmd
just1a-person commentedon Dec 11, 2020
Seems to be a MinTTY issue again...
All those people who are having this issue... While installing git, what option did you choose? (See pic)
just1a-person commentedon Dec 12, 2020
@mislav ?
mislav commentedon Dec 14, 2020
We are aware of the issue, but we don't know what part of MinTTY is incompatible with the Survey library (or vice versa).
A temporary workaround might be to disable prompting
gh config set prompt disabledand pass all necessary information via flags instead.just1a-person commentedon Dec 14, 2020
or another workaround is to use Git Bash in Windows Terminal
just1a-person commentedon Dec 23, 2020
@mislav I suggest closing this as an external bug (if you close external bugs)
ChristopherSchubert commentedon Apr 14, 2021
I downloaded the latest Git (2.31.1) and the installer had a new experimental option to run 'pseudo' consoles, without requiring winpty.
I tried it out and it resolved this issue for me on Windows 10. It allowed both arrow movement and filtering. I was able to login successfully and have not had issues since.
I did not change the terminal emulator. As an aside, it also resolved my issues with running interactive Python in Git Bash.
vilmibm commentedon Apr 28, 2021
Thanks for the hint, @ChristopherSchubert ! I just verified that that does indeed fix the issue.
As we have no control over this and it comes down to minTTY defaulting to pseudo console support, I'm going to close this issue.
For posterity, there are three workarounds for this:
Reconfigure minTTY
When installing Git For Windows, enable the pseudo console support for minTTY mentioned on this screen:
This fixes gh's prompting (as well as similar projects that do prompting).
If MinTTY is already installed, you will have to reinstall it (someone please post here if there is a way to toggle this without a reinstall).
Run with winpty
You can prefix any invocation of
ghwithwinptywhich also fixes the issue. For example:This could be used as an alias if need be.
Don't use MinTTY
If you want to use git+bash but aren't tied to MinTTY you can run git+bash via the new Windows Terminal (or use a third party terminal emulator like Alacritty or Hyper)
mislav commentedon Apr 28, 2021
In my own testing, using
winptycaused some subtle oddities and I wouldn't recommend it as a strong workaround. For example, I seem to recall that opening an editor withinwinpty gh issue createdidn't focus the editor (Notepad.exe) when it was opened, and instead opened it in the background. Somebody less experienced with GitHub CLI would not have noticed that Notepad opened in the background, and will perceive theghcommand as being stuck.vilmibm commentedon Apr 28, 2021
@mislav I think we can still mention it but call out that there might be issues (like that one). I just confirmed that running with psuedo console support enabled during installation does properly focus notepad.