It was tempting to ShowUserScreen from RawUI set-members and it was done in
PSF 5.2.2. It is a bad idea. PS core may call these members unexpectedly, and
from other threads, too.
In other words, raw console API must not be bound to Far API, at least not to
ShowUserScreen.
Symptoms in 5.2.2
Type something in the command line and call PSF TabExpansion. As a result, the
user screen is shown unexpectedly and the completion menu is shown at the left
most position, not at the expected caret position on typing.
It turns out PS plays with ForegroundColor when we call TabExpansion. We
cannot control and avoid such calls. Even if we add an ugly workaround for this
use case, we will not solve the problem in other similar cases.
It was tempting to
ShowUserScreen
fromRawUI
set-members and it was done in PSF 5.2.2. It is a bad idea. PS core may call these members unexpectedly, and from other threads, too.In other words, raw console API must not be bound to Far API, at least not to
ShowUserScreen
.Symptoms in 5.2.2
Type something in the command line and call PSF TabExpansion. As a result, the user screen is shown unexpectedly and the completion menu is shown at the left most position, not at the expected caret position on typing.
It turns out PS plays with
ForegroundColor
when we callTabExpansion
. We cannot control and avoid such calls. Even if we add an ugly workaround for this use case, we will not solve the problem in other similar cases.