microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.55k stars 8.31k forks source link

sp; mf ... leaves cursor visible in the inactive pane #17850

Open vefatica opened 2 months ago

vefatica commented 2 months ago

When I, for example, wt sp cmd.exe; mf 1, the cursor remains visible in the inactive pane. This is unlike moving focus in other situations; normally the cursor is hidden in an inactive pane.

zadjii-msft commented 2 months ago

Version number?

vefatica commented 2 months ago

That was the 20 release and the 21 preview. I just updated and the same is true of WindowsTerminal 1.22.2408.23002 (preview) and WindowsTerminal 1.21.2408.23001.

And I'm seeing this for the first time when starting the 1.21 release.

image

That's apparently from

        {
            "id": null,
            "keys": "ctrl+shift+w"
        },

Any idea?

vefatica commented 1 month ago

When I, for example, wt sp cmd.exe; mf 1, the cursor remains visible in the inactive pane. This is unlike moving focus in other situations; normally the cursor is hidden in an inactive pane.

Any more on this?

vefatica commented 1 month ago

If you have looked into this you've probably figured out that it's a matter of timing. I can reproduce the undesirable behavior (cursor showing in the inactive pane) with simulated keystrokes (using TCC's KEYSTACK command).

keystack alt-shift-+ alt-left

If I introduce a delay (9/18 second below) before moving focus, the cursor is not showing in the inactive pane.

keystack alt-shift-+ /w9 alt-left

lhecker commented 1 month ago

And I'm seeing this for the first time when starting the 1.21 release.

Is the null from you or automatically generated by us? I'm assuming the latter. In that case I think it's a bug in #17162 and I suppose we fail to remove bindings that have no action?

lhecker commented 1 month ago

I believe this issue also happens even if all you do is unfocus the application, while the terminal is currently busy with processing output that doesn't move the cursor (= pure VT).

DispatchTimer::Stop neither cancels the pending nor blocks until the queued event is done:

If Stop is called when the timer interval has just elapsed, it's possible that the timer already queued a Tick event. This event will still be raised.

So, when we do "stop the timer, then disable the cursor", we may still get a blink tick.

vefatica commented 1 month ago

I don't think I put that null in there.

vefatica commented 1 month ago

I found other ways to leave the cursor showing in an inactive pane also. One is to just do the keystrokes quickly enough ... Alt-Shift-+, Alt-Left.