On Windows 11 here. When I install or update package via the "Package Manager..." menu item, it opens up a console window that stays after the operation is done. If the window is closed, DrRacket closes.
Is this a known issue, or is there something weird going on in my environment. I tried this in a fresh VM with Racket 9.1, and it seems to be the same thing.
Of course, the workaround is using raco. I did a dive into the plugin, but I can't see where the console window is opened (my guess is a command is being forked somewhere and I/O needs to be redirected).
Just curious. I didn't want to report this as a bug until I got more context.
My expierience: whenever some internal process prints to the output-port in drracket a console window is launched that can't be closed until drracket closes. This has been this way for the last 10y.
That drrackets package manager has this behaviour feels more recent, but I'm not sure wen it started.
I have a package or two that print to stdout as part of the installation script provided in my info.rkt that racket runs during raco pkg install. I haven’t tested to see if it can trigger this behavior in DrRacket by itself, but just thought I'd mention it — maybe the behavior started for you when you installed a particular package.
That drrackets package manager has this behaviour feels more recent, but I'm not sure wen it started.
I have a package or two that print to stdout as part of the installation script provided in my info.rkt that racket runs during raco pkg install. I haven’t tested to see if it can trigger this behavior in DrRacket by itself, but just thought I'd mention it — maybe the behavior started for you when you installed a particular package.
The scribble-math package also produces output when building its docs, I think, which always seems to create hiccups in the nice progress bar/thread status HUD (this in a regular terminal, but presumably could also be part of the "DrRacket shows some output during package management").
The window is just blank. Here's my diagnosis (@mflatt can correct me if I am wrong here).
Basically, package manager forks a child process to run raco, redirecting stdio as needed to capture output in the window (and send commands). As part of this, eventually CreateProcess is called. In this code, there is a check if none of the fd parameters are system terminal fds. If that is the case, the child process window will not be opened. All other cases, a flag is set to open the child process window.
In this case, because some of those fds the child process are the ends of a pipe, the child process window will be shown. But this window is the console from the parent because the flag to create a new console has not be set when CreateProcess is called and raco is a console process.
So, the hidden console is shown. Since it is associated with the DrRacket process (and how it is set up), if it is killed, DrRacket dies, and if DrRacket is closed, the console still needs to be closed.
If I am right (and that's a if, believe me), the best fix seems to be providing an additional flag to the rktio_process flags that suppresses the child window from being opened and exposes that flag to the higher level APIs. The flag could be ignored on anything but Windows. And then the package-manager can set this flag when forking raco.
oh! Thank you very much for identifying that. It has been bothering me for a long time and I didn't know where it was coming from. I've opened a pull request to disable it.
There was a general problem related to the progress bar that is shown when raco setup is run in a terminal. The check for whether to use the progress bar forced a console window on Windows. (There are no subprocesses involved, but it's the same basic idea as @ndykman's explanation.)