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

cursor disapears when moving back along the command #171

Closed
nicwest opened this issue May 25, 2015 · 6 comments
Closed

cursor disapears when moving back along the command #171

nicwest opened this issue May 25, 2015 · 6 comments

Comments

@nicwest
Copy link

nicwest commented May 25, 2015

terminal_edited

ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)

steps to reproduce:

  1. open gnome-terminal under ubuntu
  2. enter command
  3. press the left arrow key (←)

I'm noticing that on gnome-terminal on ubuntu 15.04 that when I move back along a previous typed command the cursor disappears.

In tmux 1.9 the cursor is visible but it displays the character under cursor in italics (this may be intended, I'm unsure).

I have also experienced this issue with arch on urxvt, but identical config files on OSX seems to work fine.

@nicwest
Copy link
Author

nicwest commented May 25, 2015

removing the cursor highlighter fixed this issue.

Doh

@nicwest nicwest closed this as completed May 25, 2015
@phunehehe
Copy link

I just noticed this too. Strange that I only see this in gnome-terminal and not konsole. Makes me wonder the intended use case for the cursor highlighter though.

@danielshahaf
Copy link
Member

gnome-terminal has a blinking cursor. The blinking cycle restarts whenever the cursor is moved. I'm guessing what happens is: you press several times quickly; each press restarts the cursor blinking cycle; the cycle starts with the cursor in black, but the default cursor highlighting, which is standout, applies on top of that and makes the cursor transparent for the first half of the cycle; so, the end result is the cursor is transparent until half a second after it stops moving.

You could try:

typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[cursor]=underline

@phunehehe
Copy link

@danielshahaf you are right about everything :)
I'm not sure what the cursor highligher brings to the table, though. The docs doesn't say anything and with your snippet, it behaves just like cursor is disabled. Can you give an example?

@danielshahaf
Copy link
Member

@phunehehe A simple example is:

% ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor)
% typeset -A ZSH_HIGHLIGHT_STYLES    
% ZSH_HIGHLIGHT_STYLES=(cursor bold)
% source zsh-syntax-highlighting.zsh

to make the character under the cursor bold. See "Character Highlighting" in zshzle(1) for the available highlighting styles. I'm guessing the default (which is standout, i.e., reverse video) is useful to turn a "vertical bar" cursor into a "box" cursor without changing the terminal emulator's configuration.

@phunehehe
Copy link

thanks, that surely clears things up!

fredshonorio added a commit to fredshonorio/cfg that referenced this issue Feb 24, 2017
- emacs: added terraform package
- git: cleanup, aliases
- profile: removed python venv, added tardir
- terminator: ?
- zsh: fixed [cursor issue](zsh-users/zsh-syntax-highlighting#171)
fredshonorio added a commit to fredshonorio/cfg that referenced this issue Feb 24, 2017
- emacs: added terraform package
- git: cleanup, aliases
- profile: removed python venv, added tardir
- terminator: ?
- zsh: fixed cursor issue: zsh-users/zsh-syntax-highlighting#171
bl4ck5un pushed a commit to bl4ck5un/dotfiles that referenced this issue Nov 9, 2017
howardcochran pushed a commit to howardcochran/hcc-dotfiles that referenced this issue Dec 4, 2017
To workaround "cursor disappears when moving back along the command" issue:
zsh-users/zsh-syntax-highlighting#171
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