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
Add a spec for #7335, "console allocation policy" #7337
Conversation
/cc @bpulliam, who was asking for something like this. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thinking about it a bit.. does |
How would these interact with Process Creation Flags CREATE_NEW_CONSOLE, CREATE_NO_WINDOW, or DETACHED_PROCESS? For example, if the parent process has no console and uses CreateProcess CREATE_NEW_CONSOLE and the consoleAllocationPolicy is inheritOnly, then does the child process get a console, and does that depend on the subsystem? If |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna block on behalf of @KalleOlaviNiemitalo, because they raised a good question
Update pending on this.
This is covered in the Compatibility section. Applications will act the same way they always have contingent upon their subsystem on older versions of Windows. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely no sense in blocking this anymore 😅
Was this implemented and merged in Windows already? |
If this was already live in Windows with the spec being approved just 10 minutes ago I'd be mighty impressed ;) That being said, I too have been looking forward to it for a long time. |
Well there was a commit message referencing "the final shape of the API", which gives me the impression that this thing might be in the Windows operating system repository already. But even if it were I don't know whether it would be released in Windows 11 or 12 or what. |
Blast! Our evil plan is foiled! @DHowett I've edited your PR description, but I'm holding off on merging it just in case you want to modify it further. |
In all seriousness (and apologies, I know its annoying to just randomly message on a closed PR like this), but is this something that's likely to make it's way into 24H2, or should it not be expected until 25H2, or later? I come via PowerShell/PowerShell#3028 as we're all dying for a solution to the ongoing problems with |
I may be mistaken, but it's probably already in the Beta and Canary insider builds, ever since this update in February: https://blogs.windows.com/windows-insider/2024/02/08/announcing-windows-11-insider-preview-build-26052-canary-and-dev-channels/ |
Am I correct in assuming that using |
I am **not** proposing a change in how shells determine whether to wait for an application before returning to a prompt. | ||
This means that a console subsystem application that intends to primarily present a UI but occasionally print text to a | ||
console (therefore choosing the **detached** allocation policy) will cause the shell to "hang" and wait for it to | ||
exit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a shell's default wait for a console app should wait on the child process handle for a second and then, if the child is still running, check GetConsoleProcessList()
. If the child process ID is in the list, then continue the wait loop. Alternatively, the console API could provide a WaitForConsoleDetach()
function that simplifies this into a single call. It would return as soon as the process either terminates or calls FreeConsole()
. Explicit waiting until child process termination would still be possible via something like CMD's start /wait
command.
This is a specification for a way to customize console allocations.
The new manifest type
consoleAllocationPolicy
and the newAllocConsoleWithOptions
API were already added to the consoleclient library internally.
Closes #7335