Skip to content

Preserve Editor cursor style when updating position#144

Merged
tig merged 2 commits into
developfrom
copilot/fix-editor-update-cursor-style
May 17, 2026
Merged

Preserve Editor cursor style when updating position#144
tig merged 2 commits into
developfrom
copilot/fix-editor-update-cursor-style

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

Editor.UpdateCursor() forced CursorStyle.BlinkingBar every time it positioned the caret, overriding the user or terminal default cursor style. The editor should control cursor position/visibility without imposing a shape.

  • Cursor update behavior
    • Preserve the existing cursor style while updating Cursor.Position.
    • Use CursorStyle.Default only when making a hidden cursor visible.
Cursor = Cursor with
{
    Position = screen,
    Style = Cursor.Style == CursorStyle.Hidden ? CursorStyle.Default : Cursor.Style
};
  • Regression coverage
    • Added an integration test that verifies a configured cursor style survives a position update.
    • Relaxed the multi-caret exit assertion to require visibility instead of a hardcoded bar style.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.jetbrains.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx --profile=TG.Editor Full Cleanup (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.unix.runtimeconfig.json /home/REDACTED/.nuget/packages/jetbrains.resharper.globaltools/2026.1.1/tools/net8.0/any/cleanupcode.exe Terminal.Gui.Editor.slnx --include=src/Terminal.Gui.Editor/Editor.Drawing.cs;tests/Terminal.Gui.Editor.IntegrationTests/EditorRenderingTests.cs;tests/Terminal.Gui.Editor.IntegrationTests/EditorTests.cs (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/2f30ddfc-b986-45d4-9820-47412795cdd3

Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Editor.UpdateCursor to preserve default cursor style Preserve Editor cursor style when updating position May 17, 2026
Copilot finished work on behalf of tig May 17, 2026 07:56
Copilot AI requested a review from tig May 17, 2026 07:56
@tig tig marked this pull request as ready for review May 17, 2026 13:08
@tig tig merged commit 313caaf into develop May 17, 2026
8 checks passed
@tig tig deleted the copilot/fix-editor-update-cursor-style branch May 17, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor.UpdateCursor should not override the default cursor style

2 participants