Before you say anything, I know about right-clicking the cmd.exe window title and clicking "Properties" or "Defaults" and changing the color of the cursor. This is not what I mean for two reasons:
- It requires manual clicking instead of being a terminal command or escape sequence.
- Even if you do this, which I've tried, it doesn't hide the cursor even if the background is black and you set it to black, because it is "drawn" so that it's one pixel above the bottom line, meaning it draws a black line of pixels over whatever character happens to be at that position. (Also, it falls apart whenever the background changes, obviously.)
The same settings also allow you to change the "style" of the cursor, but none of those styles is called "none" or "empty". They are just slight variations of the blinking underscore. I am aware that you can set the blink rate globally in Windows, but that's also not relevant as it requires manual intervention and, again, doesn't hide the cursor anyway. I don't want to hide the cursor "in general" for app programs -- just for my own terminal scripts, "on demand".
I'm looking for a way to do this automatically and just for the terminal/"session" where the current script is run. (It's a PHP CLI one.)
I have tried numerous old ANSI escape sequences and whatnot; they are all seemingly ignored. My best guess at this point is that it's just not possible.
Please note that preventing the cursor from blinking, while slightly less annoying, would not solve this problem either since it would just be permanently covering the character in the first "column" on the current row.
It truly seems as if this just not is possible without downloading scary, sketchy, ancient MS-DOS executables which I don't exactly dream of trusting on my computer. I also don't want to use some third-party cmd.exe "replacer". These solutions are non-solutions to me because this is supposed to work on "vanilla" systems, whether they be Windows, Linux or Mac boxen.
I run a recent Windows 10 version but I don't have any "Windows Terminal" yet, so I can't tell if that allows this. Either way, PHP CLI on Windows appears to be closely tied to cmd.exe, so both PowerShell and Windows Terminal-related solutions aren't relevant for me at this time. Maybe in the future, when PHP on Windows starts using one of those or allows you to easily tell it to use them.
It would be quite swell to get rid of that obnoxious blinking cursor in good ol' cmd.exe.