Skip to content

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

@dawidd6

Description

@dawidd6
# .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.

Activity

z0rc

z0rc commented on Sep 10, 2019

@z0rc

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

danielshahaf commented on Sep 10, 2019

@danielshahaf
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

dawidd6 commented on Sep 12, 2019

@dawidd6
Author

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

danielshahaf commented on Sep 16, 2019

@danielshahaf
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.

changed the title [-]Completion appears bold in certain circumstance[/-] [+]First completed filename doesn't get [path] highlighting[/+] on Sep 16, 2019
danielshahaf

danielshahaf commented on Mar 19, 2020

@danielshahaf
Member

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

added a commit that references this issue on Apr 6, 2024
c14fcad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @z0rc@danielshahaf@dawidd6

        Issue actions

          First completed filename doesn't get [path] highlighting · Issue #632 · zsh-users/zsh-syntax-highlighting