Skip to content

textinput v2: Cursor changes color of text #949

@ShadiestGoat

Description

@ShadiestGoat

Describe the bug

This cursor changes the color of the text around it & there is no way to control it.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS Arch
  • Shell zsh
  • Terminal Emulator kitty
  • Terminal Multiplexer N/A
  • Locale en_US.UTF-8

To Reproduce
Steps to reproduce the behavior:

  1. New textinput model
  2. Set different color of text
  3. Enable cursor (virtual or not)
  4. Blur & focus both produce weird results

Source Code
n/a

Expected behavior
The text foreground color to remain consistent

Screenshots

Focused:

Image

Blurred:

Image

Additional context

I believe #892 would fix it - I did a temporary fix for this on my local machine, but that PR is more comprehensive:

if pos < len(value) { //nolint:nestif
    char := m.echoTransform(string(value[pos]))
    // vvvvvv this
    m.virtualCursor.TextStyle = styles.Text.Inline(true)
    // ^^^^^^ this
    m.virtualCursor.SetChar(char)
    v += m.virtualCursor.View()    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions