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

[1.15+] timeout in a batch script instantly exits a defterm window #14499

Closed
zadjii-msft opened this issue Dec 6, 2022 · 2 comments
Closed
Labels
Area-DefApp Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

Oh god this is so much worse in 1.15. It doesn't timeout at all, it instantly exits!

echo foo
@rem set /p id=Enter ID: 
timeout /t 10
echo bar
exit 1234

image

Originally posted by @zadjii-msft in #12951 (comment)

@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 Dec 6, 2022
@zadjii-msft
Copy link
Member Author

OH oh oh I bet this has to do with focus events. That's my guess - timeout will bail on input. Like, any input? That I'm not sure about. But I bet the regression between 1.12 when this was filed, and now (1.15/16/17) is the focus event stuff, and I bet eveything is immediately getting a focus event in the input queue right off the bat.

I'll need to go inspect timeout's source to confirm. That's my hypothesis.

Notably, this doesn't repro the same if you actually "restart" the batch script, until you press a key:
image

I noticed this when I restored the Terminal from being quit, and this defterm window came back (presumably, without the focus event). This might be related to #13514

Okay, my hypothesis was wrong. Looks like timeout does filter FOCUS events out... even if it does have some other horrifying code in it.

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Priority-1 A description (P1) Area-DefApp labels Dec 6, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 6, 2022
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 6, 2022
@lhecker lhecker modified the milestones: Terminal v1.18, Backlog Apr 12, 2023
@zadjii-msft
Copy link
Member Author

Uh, this looks fixed. At least in 1.19.whatever.this.selfhost.build.is

@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-DefApp Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

2 participants