Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setCursorColor() does not change the color of the cursor #342

Open
holzschu opened this issue Apr 20, 2024 · 1 comment
Open

setCursorColor() does not change the color of the cursor #342

holzschu opened this issue Apr 20, 2024 · 1 comment

Comments

@holzschu
Copy link

Describe the bug
I am calling setCursorColor() to change the color of the cursor. After the call, the cursor is still the default gray color.

To Reproduce
Call terminalView?.setCursorColor(source: (termView?.getTerminal())!, color: SwiftTerm.Color(red: 0, green: 0, blue: 65535)). The cursor does not change color after the call.

Expected behavior
I would expect the cursor to become blue after that call.

Smartphone (please complete the following information):

  • Device: iPad Pro and iPhone 8
  • OS: iOS 16.5

Additional context
It could be that I am calling the wrong function, or calling it in the wrong way, but I did not find anything in the documentation about it.
I also looked into the source code of SwiftTermApp to check for the proper call, but I could not find a single call to setCursorColor() in there.

@jbaraga
Copy link

jbaraga commented Dec 20, 2024

I am seeing the same issue with the macOS version, SwiftTerm 1.2.5. In this case:

CaretView in MacCaretView.swift:
public var caretColor: NSColor = NSColor.selectedControlColor { didSet { updateView() } }

This does not update the var bgColor; the drawCursor function of CaretView extension in CaretView.swift appears to use the bgColor rather than caretColor to draw the cursor:

context.setFillColor(bgColor)

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

No branches or pull requests

2 participants