Prompt Yes/No always defaults to no and doesn't let me choose #10786

Closed
opened 2026-01-31 02:30:17 +00:00 by claunia · 18 comments
Owner

Originally created by @usanzadunje on GitHub (Sep 26, 2020).

When i run any commands where i get questions in terminal and they require me to answer yes/no it always defaults to no and doesn't let me choose yes. I noticed this happens in PS or CMD. How can i change this behavior so i myself can choose Yes or No answer.
Bellow i entered some artisan command and immediately it choose no for me.

wt

Originally created by @usanzadunje on GitHub (Sep 26, 2020). When i run any commands where i get questions in terminal and they require me to answer yes/no it always defaults to no and doesn't let me choose yes. I noticed this happens in PS or CMD. How can i change this behavior so i myself can choose Yes or No answer. Bellow i entered some artisan command and immediately it choose no for me. ![wt](https://user-images.githubusercontent.com/22146568/94338818-8021f180-fff5-11ea-9bef-687464f6edb7.png)
Author
Owner

@jdebp commented on GitHub (Sep 27, 2020):

#7467 is definitely related per the behaviour even if the underlying cause turns out to be totally different.

@jdebp commented on GitHub (Sep 27, 2020): #7467 is definitely related per the _behaviour_ even if the underlying cause turns out to be totally different.
Author
Owner

@zadjii-msft commented on GitHub (Sep 29, 2020):

Okay I'm not really sure where to get artisan from, but on the surface this looks like a real bug.

@usanzadunje which version of php, and which version of the Windows Terminal are you using?

@zadjii-msft commented on GitHub (Sep 29, 2020): Okay I'm not really sure where to get `artisan` from, but on the surface this looks like a real bug. @usanzadunje which version of `php`, and which version of the Windows Terminal are you using?
Author
Owner

@usanzadunje commented on GitHub (Sep 29, 2020):

Its laravel feature to generate stuff and more. It really isnt important, i knew how to make command that will prompt question in Laravel so i did it there. But the problem occurs wherever i have prompted question in terminal. I mean there is probably some windows command which does something and then asks ... do you really want to do this? and then you can type y/n (yes/no) after which it executes command depending on what you entered. This happens when i use composer, npm. Im just listing this things cause i know them, but im 100% sure it would do the same thing on windows command that does same like i meantioned above.

I am using 7.4 PHP but as said i am pretty sure this isnt problem with php laravel or anything similar since it happens wherever there is command that prompts question.

Terminal version is this 1.3.2651.0 , i think.
@zadjii-msft

@usanzadunje commented on GitHub (Sep 29, 2020): Its laravel feature to generate stuff and more. It really isnt important, i knew how to make command that will prompt question in Laravel so i did it there. But the problem occurs wherever i have prompted question in terminal. I mean there is probably some windows command which does something and then asks ... do you really want to do this? and then you can type y/n (yes/no) after which it executes command depending on what you entered. This happens when i use composer, npm. Im just listing this things cause i know them, but im 100% sure it would do the same thing on windows command that does same like i meantioned above. I am using 7.4 PHP but as said i am pretty sure this isnt problem with php laravel or anything similar since it happens wherever there is command that prompts question. Terminal version is this 1.3.2651.0 , i think. @zadjii-msft
Author
Owner

@DHowett commented on GitHub (Sep 30, 2020):

I've got a feeling that whatever Windows Console API adapter PHP is using is subject to the same issue described in https://github.com/microsoft/terminal/issues/3910#issuecomment-668252425.

If you set the setting (globally!) "experimental.input.forceVT": true, does it start working again?

@DHowett commented on GitHub (Sep 30, 2020): I've got a feeling that whatever Windows Console API adapter PHP is using is subject to the same issue described in https://github.com/microsoft/terminal/issues/3910#issuecomment-668252425. If you set the setting (globally!) `"experimental.input.forceVT": true`, does it start working again?
Author
Owner

@zadjii-msft commented on GitHub (Sep 30, 2020):

I mean, knowing exactly what is causing this is actually quite important, because lots of different commandline applications prompt for input in lots of different ways. choice in cmd will set %errorlevel%, but that's working perfectly fine for me

image

So finding the exact broken application is actually quite important

@zadjii-msft commented on GitHub (Sep 30, 2020): I mean, knowing exactly _what_ is causing this is actually quite important, because lots of different commandline applications prompt for input in lots of different ways. `choice` in `cmd` will set `%errorlevel%`, but that's working perfectly fine for me ![image](https://user-images.githubusercontent.com/18356694/94625461-6b0bc380-027e-11eb-8e9b-74fa69c9c49c.png) So finding the exact broken application is actually quite important
Author
Owner

@usanzadunje commented on GitHub (Sep 30, 2020):

@DHowett "experimental.input.forceVT": true -> This did not help, problem is still there.

@zadjii-msft Actually when i write what you did it doesnt choose y,n,c for me but i can choose myself and it works.

So this happens to me on laravels php artisan commands.

Before i used everything with no problem on my laptop(it had win 10 as well and everything same as my computer that has this problem) and now it doesnt work as expected. Also its really strange to me that i cannot find single article or post with this problem..

@usanzadunje commented on GitHub (Sep 30, 2020): @DHowett "experimental.input.forceVT": true -> This did not help, problem is still there. @zadjii-msft Actually when i write what you did it doesnt choose y,n,c for me but i can choose myself and it works. So this happens to me on laravels php artisan commands. Before i used everything with no problem on my laptop(it had win 10 as well and everything same as my computer that has this problem) and now it doesnt work as expected. Also its really strange to me that i cannot find single article or post with this problem..
Author
Owner

@usanzadunje commented on GitHub (Oct 2, 2020):

Is there anyone who can help with this problem? I even contacted microsoft agent, and spent 2 days doing what i was told in order to fix this issue, nothing helped.

@usanzadunje commented on GitHub (Oct 2, 2020): Is there anyone who can help with this problem? I even contacted microsoft agent, and spent 2 days doing what i was told in order to fix this issue, nothing helped.
Author
Owner

@DHowett commented on GitHub (Oct 2, 2020):

You've found a bug in our terminal and we need some time to fix it. There does not appear to be a workaround. You tested something we thought would fix it, and it did not. This means that it is a bug that we need to fix.

@DHowett commented on GitHub (Oct 2, 2020): You've found a bug in our terminal and we need some time to fix it. There does not appear to be a workaround. You tested something we thought would fix it, and it did not. This means that it is a bug that we need to fix.
Author
Owner

@jdebp commented on GitHub (Oct 6, 2020):

The problem here is reproducing the bug. I can and have reproduced #7467, and even if upgrading ssh-keygen avoids the problem, this shows that there's definitely some kind of I/O that works with the old console server and doesn't work with the new one. The problem for the Microsoft people is the question: What kind of I/O is it? That's the first step to fixing the problem: identifying its locus.

Cranking up an entire PHP setup is not the easiest way to replicate a problem. In general, developers fix these problems more quickly if you can provide a simple method of replicating them; not a complex setup involving a PHP toolset that they've never even heard of. And the Microsoft people who work on Windows Terminal might not even be PHP developers.

As you can see, this doesn't happen with choice. So the challenge is for you, or other people with this problem, to find an example of it that does not involve specialist toolsets that the Microsoft people here might never have heard of or be able to set up. Try to find some simple well-known tool exhibiting the problem that isn't PHP. I'd firstly be checking out ones built with the same run-time library and compiler, in your place.

Personally, I think that #7467 should be open, as clearly there's something that ssh-keygen used to do that is a problem, and identifying what it was might well be useful.

@jdebp commented on GitHub (Oct 6, 2020): The problem here is reproducing the bug. I can and have reproduced #7467, and even if upgrading `ssh-keygen` avoids the problem, this shows that there's definitely _some kind_ of I/O that works with the old console server and doesn't work with the new one. The problem for the Microsoft people is the question: _What_ kind of I/O is it? That's the first step to fixing the problem: identifying its locus. Cranking up an entire PHP setup is not the easiest way to replicate a problem. In general, developers fix these problems more quickly if you can provide a _simple_ method of replicating them; not a complex setup involving a PHP toolset that they've never even heard of. And the Microsoft people who work on Windows Terminal might not even be PHP developers. As you can see, this doesn't happen with `choice`. So the challenge is for you, or other people with this problem, to find an example of it that does not involve specialist toolsets that the Microsoft people here might never have heard of or be able to set up. Try to find some _simple_ well-known tool exhibiting the problem that isn't PHP. I'd firstly be checking out ones built with the same run-time library and compiler, in your place. Personally, I think that #7467 should be open, as clearly there's something that `ssh-keygen` _used to do_ that is a problem, and identifying what it was might well be useful.
Author
Owner

@usanzadunje commented on GitHub (Oct 8, 2020):

@DHowett Alright, thanks for info.

@jdebp I mean i asked in several places people to give me some windows cmd or ps command that does anything and then prompts a question, idk something like do you want to continue or are you sure you want to do this or do you really want to.. so it prompts this question and then i need to answer with y/n(yes/no). So i can test if this bug actually happens on windows commands as well. If you know any please provice. I searched internet but i dont know how to actually search for these type of commands.

@usanzadunje commented on GitHub (Oct 8, 2020): @DHowett Alright, thanks for info. @jdebp I mean i asked in several places people to give me some windows cmd or ps command that does anything and then prompts a question, idk something like do you want to continue or are you sure you want to do this or do you really want to.. so it prompts this question and then i need to answer with y/n(yes/no). So i can test if this bug actually happens on windows commands as well. If you know any please provice. I searched internet but i dont know how to actually search for these type of commands.
Author
Owner

@usanzadunje commented on GitHub (Oct 8, 2020):

Okay, by luck i got one of these commands. I used scott hanselman pretty terminal and there is command 'Install-Module posh-git -Scope CurrentUser' which promts yes/yes for all etc.. and it actually did not chose for me but let me chose the option. So i hope this helps to narrow down the problem.

@usanzadunje commented on GitHub (Oct 8, 2020): Okay, by luck i got one of these commands. I used scott hanselman pretty terminal and there is command 'Install-Module posh-git -Scope CurrentUser' which promts yes/yes for all etc.. and it actually did not chose for me but let me chose the option. So i hope this helps to narrow down the problem.
Author
Owner

@DHowett commented on GitHub (Oct 9, 2020):

What keyboard layout are you using?

I cannot reproduce this with the *-Module commands in PowerShell, either. ☹️

image

@DHowett commented on GitHub (Oct 9, 2020): What keyboard layout are you using? I cannot reproduce this with the `*-Module` commands in PowerShell, either. ☹️ ![image](https://user-images.githubusercontent.com/189190/95529699-76eb3a00-0990-11eb-902c-0fe056684db9.png)
Author
Owner

@usanzadunje commented on GitHub (Oct 9, 2020):

@DHowett English(United States) - US
Doesnt this mean problem has something to do with php. Since when i use laravel(php framework) commands terminal doesnt let me choose answer for prompted questions and when i used this command 'Install-Module posh-git -Scope CurrentUser' for PowerShell ,terminal actually work fine and let me choose answer for prompted question (Are yo sure you want to perform this action?).

@usanzadunje commented on GitHub (Oct 9, 2020): @DHowett English(United States) - US Doesnt this mean problem has something to do with php. Since when i use laravel(php framework) commands terminal doesnt let me choose answer for prompted questions and when i used this command 'Install-Module posh-git -Scope CurrentUser' for PowerShell ,terminal actually work fine and let me choose answer for prompted question (Are yo sure you want to perform this action?).
Author
Owner

@usanzadunje commented on GitHub (Oct 20, 2020):

@DHowett Are there any news?

@usanzadunje commented on GitHub (Oct 20, 2020): @DHowett Are there any news?
Author
Owner

@zadjii-msft commented on GitHub (Oct 20, 2020):

Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?
image
That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️

@zadjii-msft commented on GitHub (Oct 20, 2020): Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button? ![image](https://user-images.githubusercontent.com/18356694/91237459-5cbb0c80-e700-11ea-9347-b9b1ec2813b1.png) That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️
Author
Owner

@zadjii-msft commented on GitHub (Aug 19, 2021):

You know what - I'm gonna make an executive call here and say that if we can get a precise, minimal repro for this issue, we can keep investigating it. If you've got a gist of PHP code, or a precise set of commands to execute to repro this, we can take another look. Clearly, it's possible to prompt for input successfully in the Terminal, so I'm guessing this is a framework issue.

@zadjii-msft commented on GitHub (Aug 19, 2021): You know what - I'm gonna make an executive call here and say that _if we can get a precise, minimal repro_ for this issue, we can keep investigating it. If you've got a [gist](https://gist.github.com/) of PHP code, or a precise set of commands to execute to repro this, we can take another look. Clearly, it's possible to prompt for input successfully in the Terminal, so I'm guessing this is a framework issue.
Author
Owner

@ghost commented on GitHub (Aug 23, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 23, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@xiaodongning commented on GitHub (Nov 8, 2021):

When i run any commands where i get questions in terminal and they require me to answer yes/no it always defaults to no and doesn't let me choose yes. I noticed this happens in PS or CMD. How can i change this behavior so i myself can choose Yes or No answer. Bellow i entered some artisan command and immediately it choose no for me.

wt

hello! Have you solved the problem

@xiaodongning commented on GitHub (Nov 8, 2021): > When i run any commands where i get questions in terminal and they require me to answer yes/no it always defaults to no and doesn't let me choose yes. I noticed this happens in PS or CMD. How can i change this behavior so i myself can choose Yes or No answer. Bellow i entered some artisan command and immediately it choose no for me. > > ![wt](https://user-images.githubusercontent.com/22146568/94338818-8021f180-fff5-11ea-9bef-687464f6edb7.png) hello! Have you solved the problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10786