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

First completed filename doesn't get [path] highlighting #632

Closed
dawidd6 opened this issue Sep 10, 2019 · 5 comments
Closed

First completed filename doesn't get [path] highlighting #632

dawidd6 opened this issue Sep 10, 2019 · 5 comments

Comments

@dawidd6
Copy link

dawidd6 commented Sep 10, 2019

# .zshrc
export ZSH="$HOME/.oh-my-zsh"
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
export PATH="$HOME/go/bin:$HOMEBREW_PREFIX/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

ZSH_THEME="robbyrussell"

if ! test -d "$ZSH"; then
    git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh "$ZSH"
fi

if type brew &>/dev/null; then
    eval $(SHELL=zsh brew shellenv)
fi

source $ZSH/oh-my-zsh.sh
source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

When one for example writes docker-comp, completes it with TAB and then presses TAB to get a completion inserted, it is inserted, but in bold. This does not happen when oh-my-zsh is not sourced or command is entered manually from start to the end.

asciicast

As one can see, entering TAB right after command, produces bold completion and when a space is already in place after command the inserted text is not bold as it should be.

@z0rc
Copy link

z0rc commented Sep 10, 2019

Bold text representation depends on terminal emulator. Look into terminal settings for options like "Draw intense colors with bold font". If this true for you, adjust highlight styles to better match your preference and terminal color palette.

@danielshahaf
Copy link
Member

This does not happen when oh-my-zsh is not sourced

Please provide a minimal reproducer using zsh -f with no external dependencies.

Please confirm that disabling zsh-syntax-highlighting fixes the symptoms.

@dawidd6
Copy link
Author

dawidd6 commented Sep 12, 2019

It does not happen when:

  • zsh is run with -f option
  • zsh-syntax-highlighting is disabled

Also when I disable oh-my-zsh, then only the first completion is bold, later entries that appear by pressing TAB are normal.

I'm using gnome-terminal on Ubuntu 19.04 with zsh 5.7.1 and zsh-syntax-highlighting 0.6.0 (tested latest master and it's the same).

@z0rc I don't see any option like this.

Update: just tested xterm and it is the same.

Out of curiosity I also tried https://github.com/zdharma/fast-syntax-highlighting and the issue is there too.

@danielshahaf
Copy link
Member

I've been able to reproduce something similar to this.

With z-sy-h master and zsh master (I haven't checked earlier versions of either), if I do:

$ zsh -f
% source ./zsh-syntax-highlighting.zsh
% ls <TAB><TAB>

then after the first <TAB>, the filename shown isn't underlined. After subsequent <TAB> presses the filenames get underlined. I press <TAB> enough times for the first filename to be offered a second time and at that point it did get underlined.

@dawidd6 When I requested a reproducer, this is what I meant: a minimal sequence of steps that starts from zsh -f and demonstrates the problem.

@danielshahaf danielshahaf changed the title Completion appears bold in certain circumstance First completed filename doesn't get [path] highlighting Sep 16, 2019
@danielshahaf danielshahaf added Bug and removed Question labels Sep 16, 2019
@danielshahaf
Copy link
Member

Works for me if I merge the feature/redrawhook branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants