Re: Why does cli_set_process_title sometimes change the wrong process'title?

From: Date: Sun, 12 Apr 2020 13:09:47 +0000
Subject: Re: Why does cli_set_process_title sometimes change the wrong process'title?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-31470@lists.php.net to get a copy of this message
On 12.04.2020 at 11:29, tutiluren@tutanota.com wrote: > I currently only run PHP on Windows, so I have no idea if the same thing happens on the other > platforms. > > I frequently call cli_set_process_title() in my CLI PHP scripts to set the "process > title". Normally, there are no problems at all. > > However, on at least two separate occasions, the last time yesterday, something very strange > happened at some unknown point: one of the cli_set_process_title() calls changed the process title > of a completely different process/window: the PHP built-in webserver one! > > I start both the built-in PHP webserver and my own PHP CLI scripts with ..bat files. My CLI PHP > scripts end up in the cmd.exe group in the Taskbar. > > How can this be technically and logically possible? Is it a known issue? Is it known why and > when this happens? I have no idea how I'd reproduce it since it rarely does this, but once it > has done so, the process/window in question keeps its title forever, until I close it and restart > it. (Which of course spawns a new process.) > > This really frustrates me, because it's such a weird bug/glitch. cli_set_process_title() basically just calls SetConsoleTitle()[1], so I can't see why that would affect an unrelated console window. More information regarding your environment (which Windows version? which PHP version and variant?) and also about how you start these processes (start, cmd /c etc.) might be helpful. [1] <https://docs.microsoft.com/en-us/windows/console/setconsoletitle> -- Christoph M. Becker

« previous php.windows (#31470) next »