charmbracelet / bubbletea

A powerful little TUI framework 🏗

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cursor visible in `cmd.exe` on Windows when the altscreen is active

jon4hz opened this issue · comments

I've tested a bubbletea program on windows 11 and it seems that the cursor always stays visible in the left corner of the terminal. In the windows terminal as well as in powershell. It seems that newer versions of windows terminal have fixed this. Affected is only cmd.exe / powershell.

Is this after the cursor is shown via spawning another terminal-based program or are you finding the cursor is always visible in Bubble Tea applications on Windows 11 in general?

The cursor is always visible in general. Just keeps blinking in the lower left corner.

Eg:

image

Okay, interesting. I'm seeing this behavior in Windows 11, but only when both of these conditions are met:

  1. In the legacy command console (cmd.exe) and Powershell standalone app (Powershell standalone runs cmd.exe under the hood) — Windows Terminal seems fine
  2. When the altscreen is active (i.e. I see it in the list-default example, but not list-simple)

Let me know if this is what you're seeing on your end too. Either way, this is a bug.

I just saw that windows 11 has a pretty outdated version of the windows terminal preinstalled by default. After upgrading to version 1.11.... the bug in the windows terminal seems to be fixed. However the bug is still there in powershell / cmd.exe and your statement is correct.
I could reproduce the bug if the conditions you mentioned are met.

Noted, thank you. With any luck when we fix the bug in cmd.exe it'll also fix the bug in older versions of Windows Terminal.