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

invisible cursor in term #145

Closed
kwon-young opened this issue Jun 18, 2016 · 4 comments
Closed

invisible cursor in term #145

kwon-young opened this issue Jun 18, 2016 · 4 comments

Comments

@kwon-young
Copy link

Since commit 11a6dcc, the cursor in neovim terminal is not visible.
Example of neovim term in commit 11a6dcc:
spectacle tt3861
Example of neovim term in precedent commit 63a9f16:
spectacle et3861

Cheers and thanks for your awesome work !

@equalsraf
Copy link
Owner

Interesting it only happens in terminal mode, also only seems to happen when the cursor is not on top of anything else.

Hypothesis: the terminal mode is explicitly drawing the cursor using the reverse attribute. But we draw our own cursor that inverts colors too.

e.g. this patch "fixes" the cursor in terminal mode by disabling the drawing of the cursor.

diff --git a/src/gui/shell.cpp b/src/gui/shell.cpp
index c445129..7cfe47d 100644
--- a/src/gui/shell.cpp
+++ b/src/gui/shell.cpp
@@ -534,7 +534,7 @@ void Shell::paintEvent(QPaintEvent *ev)
                }
                QPainter painter(this);
                painter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
-               painter.fillRect(cursorRect, m_cursor_color);
+//             painter.fillRect(cursorRect, m_cursor_color);
        }
 }

its not that the cursor is not there it just so happens the cursor is drawn by reversing the colors and the reverse color is the same as the background - for e.g. try testing with the colorscheme blue you should see the cursor then.

TLDR we need a better strategy to draw the cursor, or a way to avoid drawing the cursor in :term

@khalidchawtany
Copy link
Contributor

@equalsraf If I apply this, I get the cursor back in terminal. However, I loose it in normal mode :(

@khalidchawtany
Copy link
Contributor

I can get around invisible terminal cursor through setting the following:

  let g:terminal_color_7  = '#FBBC05'

The above is dark yellow and when the inverse is taken a dark blue cursor is displayed in the terminal.

@kwon-young
Copy link
Author

Closing this issue, since I can't reproduce the bug.

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

3 participants