Skip to main content
added 547 characters in body
Source Link
grawity_u1686
  • 465.3k
  • 66
  • 977
  • 1.1k

If I execute a command such as "php test.php" directly, without any terminal attached, it opens a PHP-branded window of some sort, but appears to use a cmd.exe "behind the scenes", so this is just the same as explicitly using cmd.exe.

It does not. Rather, both php.exe and cmd.exe (and PowerShell.exe, for that matter) use the same kind of automatic console window that is nowadays known as "Conhost" as of Vista, previously part of CSRSS in XP.

Conhost is the built-in terminal/console that is automatically opened for all such apps that have the 'console' flag set in their .exe files (though until Windows 8.1 it did not have any of the Unix-style terminal control capabilities, hence the term "console" rather than "terminal").

(It's actually Conhost that also "remembers" the console window appearances per-executable and/or per-shortcut, causing e.g. the PowerShell.exe console to have a blue background by default – though I suspect PowerShell may also deliberately tweak its console font on startup as well.)

Cmd.exe and PowerShell on their own have no visual appearance (not counting the old PowerShell ISE, that is) – they both always run either in Conhost or in Windows Terminal, with the OS automatically opening Conhost if needed. (As of Windows 11, the OS can automatically open Windows Terminal instead.)

Launching 100 PHP CLI scripts with PowerShell or Windows Terminal (yes, even with new tabs instead of new separate instances!) causes my powerful computer to become unusable. All CPU and tons of RAM is used, and all kinds of error messages start popping up and the Taskbar icon becomes impossible to click to show the windows; everything "glitches out".

Windows Terminal uses GPU rendering (as does the Windows 10 Start Menu UI), so I'm guessing this probably indicates inefficiencies in its architecture, causing them to compete for resources. Try to enable the alternative "Atlas" rendering engine through its profile settings.

Is there some secret way to launch "minimal" versions of them or something? It doesn't seem like I could even buy a machine powerful enough to power my (relatively) few CLI instances.

You're already doing that. The Conhost console window you get when running either php.exe or cmd.exe is as minimal as it gets.

If I execute a command such as "php test.php" directly, without any terminal attached, it opens a PHP-branded window of some sort, but appears to use a cmd.exe "behind the scenes", so this is just the same as explicitly using cmd.exe.

It does not. Rather, both php.exe and cmd.exe (and PowerShell.exe, for that matter) use the same kind of automatic console window that is nowadays known as "Conhost" as of Vista, previously part of CSRSS in XP.

Conhost is the built-in terminal/console that is automatically opened for all such apps that have the 'console' flag set in their .exe files (though until Windows 8.1 it did not have any of the Unix-style terminal control capabilities, hence the term "console" rather than "terminal").

(It's actually Conhost that also "remembers" the console window appearances per-executable and/or per-shortcut, causing e.g. the PowerShell.exe console to have a blue background by default – though I suspect PowerShell may also deliberately tweak its console font on startup as well.)

Cmd.exe and PowerShell on their own have no visual appearance (not counting the old PowerShell ISE, that is) – they both always run either in Conhost or in Windows Terminal, with the OS automatically opening Conhost if needed. (As of Windows 11, the OS can automatically open Windows Terminal instead.)

Is there some secret way to launch "minimal" versions of them or something? It doesn't seem like I could even buy a machine powerful enough to power my (relatively) few CLI instances.

You're already doing that. The Conhost console window you get when running either php.exe or cmd.exe is as minimal as it gets.

If I execute a command such as "php test.php" directly, without any terminal attached, it opens a PHP-branded window of some sort, but appears to use a cmd.exe "behind the scenes", so this is just the same as explicitly using cmd.exe.

It does not. Rather, both php.exe and cmd.exe (and PowerShell.exe, for that matter) use the same kind of automatic console window that is nowadays known as "Conhost" as of Vista, previously part of CSRSS in XP.

Conhost is the built-in terminal/console that is automatically opened for all such apps that have the 'console' flag set in their .exe files (though until Windows 8.1 it did not have any of the Unix-style terminal control capabilities, hence the term "console" rather than "terminal").

(It's actually Conhost that also "remembers" the console window appearances per-executable and/or per-shortcut, causing e.g. the PowerShell.exe console to have a blue background by default – though I suspect PowerShell may also deliberately tweak its console font on startup as well.)

Cmd.exe and PowerShell on their own have no visual appearance (not counting the old PowerShell ISE, that is) – they both always run either in Conhost or in Windows Terminal, with the OS automatically opening Conhost if needed. (As of Windows 11, the OS can automatically open Windows Terminal instead.)

Launching 100 PHP CLI scripts with PowerShell or Windows Terminal (yes, even with new tabs instead of new separate instances!) causes my powerful computer to become unusable. All CPU and tons of RAM is used, and all kinds of error messages start popping up and the Taskbar icon becomes impossible to click to show the windows; everything "glitches out".

Windows Terminal uses GPU rendering (as does the Windows 10 Start Menu UI), so I'm guessing this probably indicates inefficiencies in its architecture, causing them to compete for resources. Try to enable the alternative "Atlas" rendering engine through its profile settings.

Is there some secret way to launch "minimal" versions of them or something? It doesn't seem like I could even buy a machine powerful enough to power my (relatively) few CLI instances.

You're already doing that. The Conhost console window you get when running either php.exe or cmd.exe is as minimal as it gets.

Source Link
grawity_u1686
  • 465.3k
  • 66
  • 977
  • 1.1k

If I execute a command such as "php test.php" directly, without any terminal attached, it opens a PHP-branded window of some sort, but appears to use a cmd.exe "behind the scenes", so this is just the same as explicitly using cmd.exe.

It does not. Rather, both php.exe and cmd.exe (and PowerShell.exe, for that matter) use the same kind of automatic console window that is nowadays known as "Conhost" as of Vista, previously part of CSRSS in XP.

Conhost is the built-in terminal/console that is automatically opened for all such apps that have the 'console' flag set in their .exe files (though until Windows 8.1 it did not have any of the Unix-style terminal control capabilities, hence the term "console" rather than "terminal").

(It's actually Conhost that also "remembers" the console window appearances per-executable and/or per-shortcut, causing e.g. the PowerShell.exe console to have a blue background by default – though I suspect PowerShell may also deliberately tweak its console font on startup as well.)

Cmd.exe and PowerShell on their own have no visual appearance (not counting the old PowerShell ISE, that is) – they both always run either in Conhost or in Windows Terminal, with the OS automatically opening Conhost if needed. (As of Windows 11, the OS can automatically open Windows Terminal instead.)

Is there some secret way to launch "minimal" versions of them or something? It doesn't seem like I could even buy a machine powerful enough to power my (relatively) few CLI instances.

You're already doing that. The Conhost console window you get when running either php.exe or cmd.exe is as minimal as it gets.