How to customize the default CursorSize in Powershell

I set he default CursorSize in $PROFILE file like:

[Console]::CursorSize = 10

or

$HOST.UI.RawUI.CursorSize = 10

But the cursorSize will reset after using another console in powershell, for example: enter image description here

Also, I set CursorSize from the Registy Editor: enter image description here and enter image description here

Is there any way to change the default CursorSize permanently?


Solution 1:

1, try put your customization codes into file $profile.CurrentUserAllHosts instead and see if it applies to the python shell.

2, if it doesn't work, put your codes within the function prompt so that the codes will be forced to be invoked every time the prompt is printed.