System's Text Cursor Indicator is ignored on new tab and also moving its window using only keyboard and GuiThreadInfo's GetCaretPos doesn't return its caret position #9468

Open
opened 2026-01-31 01:55:18 +00:00 by claunia · 0 comments
Owner

Originally created by @vhanla on GitHub (Jul 6, 2020).

Environment

Windows build number: Microsoft Windows [Versión 10.0.19041.329]
Windows Terminal version (if applicable): 1.0.1811.0

Any other software?

Steps to reproduce

Enable Windows's Text Cursor Indicator in Control Panel.
imagen

1st scenario.

Open a new TAB, then you will notice that the Text Cursor Indicator is not working anymore.
cursor issue 01b

2nd scenario.

Move current Windows Terminal window using only keyboard as following:
Press Alt+Space select Move menu item then move it using the arrow keys.
Now the Text Cursor Indicator stops following your typing cursor position.
imagen
imagen

3rd scenario.

Use Winapi using GetGUIThreadInfo combined with GetCaretPos, to ge curret window's caret position.
Or just use the demo project from https://www.codeproject.com/articles/34520/getting-caret-position-inside-any-application
It works even CMD and PowerShell, but not in Windows Terminal.

Expected behavior

Keep tracking the text cursor indicator, without using workarounds to restore it as mentioned below.

And for the GetCaretPos issue, it should return the caret poition for third party tools, not only system's Text Cursor Indicator.

Actual behavior

Text cursor indicator is ignored after those steps, and needs other steps to restore th cursor indicator tracker.

NOTICE To restore Text Cursor Indicator is possible by switching back and forth wih Alt+Tab or switching among tabs.

About the GetCaretPos issue, I wrote a tool to highlight the caret position for teaching purposes, specially to attract attention towards the caret position, it even follows the caret position.
imagen
Since GetCaretPos offers that opportunity to achieve that, it is a convenient way for tools like this to help users for whatever reasons they want, like the tool in the picture above, which is working perfectly in the cmd console shell, notepad, powershell's, etc.
However, on Windows Terminal (and Visual Studio Code too) GetCaretPos doesn't work as expected.

I reported this issues since they seem related in someway.

Originally created by @vhanla on GitHub (Jul 6, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Versión 10.0.19041.329] Windows Terminal version (if applicable): 1.0.1811.0 Any other software? ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> Enable Windows's **Text Cursor Indicator** in Control Panel. ![imagen](https://user-images.githubusercontent.com/1015823/86634592-ab1d1c00-bf97-11ea-8161-c8782b5dd8be.png) ## 1st scenario. Open a new TAB, then you will notice that the Text Cursor Indicator is not working anymore. ![cursor issue 01b](https://user-images.githubusercontent.com/1015823/86634445-7b6e1400-bf97-11ea-8ad9-16b40ba1bae3.gif) ## 2nd scenario. Move current Windows Terminal window using only keyboard as following: Press `Alt`+`Space` select `Move` menu item then move it using the arrow keys. Now the Text Cursor Indicator stops following your typing cursor position. ![imagen](https://user-images.githubusercontent.com/1015823/86634813-f33c3e80-bf97-11ea-88bb-3d4e53236aaa.png) ![imagen](https://user-images.githubusercontent.com/1015823/86635096-4a421380-bf98-11ea-80db-a233677340fd.png) ## 3rd scenario. Use Winapi using GetGUIThreadInfo combined with GetCaretPos, to ge curret window's caret position. Or just use the demo project from https://www.codeproject.com/articles/34520/getting-caret-position-inside-any-application It works even CMD and PowerShell, but not in Windows Terminal. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> Keep tracking the text cursor indicator, without using workarounds to restore it as mentioned below. And for the GetCaretPos issue, it should return the caret poition for third party tools, not only system's Text Cursor Indicator. # Actual behavior <!-- What's actually happening? --> Text cursor indicator is ignored after those steps, and needs other steps to restore th cursor indicator tracker. **NOTICE** To restore Text Cursor Indicator is possible by switching back and forth wih `Alt`+`Tab` or switching among tabs. About the GetCaretPos issue, I wrote a tool to highlight the caret position for teaching purposes, specially to attract attention towards the caret position, it even follows the caret position. ![imagen](https://user-images.githubusercontent.com/1015823/86640911-55993d00-bfa0-11ea-9667-542d25f95dfe.png) Since GetCaretPos offers that opportunity to achieve that, it is a convenient way for tools like this to help users for whatever reasons they want, like the tool in the picture above, which is working perfectly in the cmd console shell, notepad, powershell's, etc. However, on Windows Terminal (and Visual Studio Code too) GetCaretPos doesn't work as expected. I reported this issues since they seem related in someway.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9468