Skip to content

[bug]: visual issue  #277

Closed
Closed

Description

@asumbek

Environment

Arch Linux proot inside Termux, zsh 5.9 (armv7l-unknown-linux-gnueabihf), zi git commit 75929e8

Reproduction steps

`zi -h` or `exec zsh` to install plugins/snippets

Expected behavior

1. No error is shown while showing command usage.
2. Git clone progress bar not printed every line.

Current behavior

1. Errors about `character not in range` printed when executing zi with `-h` flag. (See screenshot)
2. The Git clone progress bar printed every 
line. (See screenshot)

Code snippet

{# OMZ plugins
}

{# plugins
    zi load "agkozak/agkozak-zsh-prompt"; {
        bindkey -v

        AGKOZAK_CMD_EXEC_TIME=3

        AGKOZAK_COLORS_CMD_EXEC_TIME=117
        AGKOZAK_COLORS_EXIT_STATUS=196
        AGKOZAK_COLORS_PATH=69
        AGKOZAK_COLORS_BRANCH_STATUS=76
        AGKOZAKTIDE_COLORS_PROMPT_NORMAL=76
        AGKOZAKTIDE_COLORS_PROMPT_VI=45
        AGKOZAKTIDE_COLORS_PROMPT_NONZERO=196
        AGKOZAKTIDE_COLORS_CLOCK=default

        AGKOZAK_CUSTOM_PROMPT=$'\n'
        # Directory
        AGKOZAK_CUSTOM_PROMPT+=$'%B%F{$AGKOZAK_COLORS_PATH}%2v%f%b'
        # Exec time
        AGKOZAK_CUSTOM_PROMPT+=$'%(9V.\n%F{$AGKOZAK_COLORS_CMD_EXEC_TIME}%9v :: %f.)'
        # Exit code & Job
        AGKOZAK_CUSTOM_PROMPT+=$'%(?..%(9V..\n)[%F{$AGKOZAK_COLORS_EXIT_STATUS}:%?%f%(1j..]))%(1j.%(?.\n[. )%F{$AGKOZAK_COLORS_BG_STRING}*%j%f].)'
        # Prompt
        AGKOZAK_CUSTOM_PROMPT+=$'\n%(?.%(4V.%F{$AGKOZAKTIDE_COLORS_PROMPT_VI}≈>%f.%F{$AGKOZAKTIDE_COLORS_PROMPT_NORMAL}=>%f).%F{$AGKOZAKTIDE_COLORS_PROMPT_NONZERO}=>%f) '

        AGKOZAK_CUSTOM_RPROMPT=""
        # Git status
        AGKOZAK_CUSTOM_RPROMPT+=$'%(3V.%F{${AGKOZAK_COLORS_BRANCH_STATUS}}%6v%(7V. %7v.)%f.) '
        # Clock
        AGKOZAK_CUSTOM_RPROMPT+="%F{$AGKOZAKTIDE_COLORS_CLOCK}%*%f"
    }

    zi ice pick"themes/catppuccin_mocha-zsh-syntax-highlighting.zsh"
    zi load "catppuccin/zsh-syntax-highlighting"

    zi ice pick"zsh-syntax-highlighting.zsh"
    zi load "zsh-users/zsh-syntax-highlighting"

    zi ice pick"zsh-autosuggestions.zsh"
    zi load "zsh-users/zsh-autosuggestions"; {
        ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#9399b2"
    }

    zi ice pick"zsh-history-substring-search.zsh"
    zi load "zsh-users/zsh-history-substring-search"; {
        bindkey '^[[A' history-substring-search-up
        bindkey '^[[B' history-substring-search-down

        HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="underline,bold"
        HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND="fg=1,underline,bold"
    }

    zi load "skywind3000/z.lua"; {}

    zi load "davidde/git"; {}

    zi load "cjayross/up"; {}

    zi load "jeffreytse/zsh-vi-mode"; {}

    zi load "hcgraf/zsh-sudo"; {}
}

Additional information

Screenshots:
Screenshot_20230711-170945_Termux
Screenshot_20230711-170617_Termux

Self-service

  • I'd be willing to address this documentation request myself.

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

No response

### Tasks

Activity

  1. changed the title [-][bug]: [/-] [+][bug]: visual issue [/+] on Jul 11, 2023
  2. ss-o commented on Aug 8, 2023

    @ss-o
    Member

    Hi @UrNightmaree,

    Thank you for opening an issue report 🤝 I have scheduled a triage and will update you on the progress 🎯

    Please provide information about your terminal emulator ❔

    Thanks.

  3. asumbek commented on Aug 9, 2023

    @asumbek
    Author

    Hello @ss-o, thank you for responding my issue. 🙏

    Please provide information about your terminal emulator ❔

    It's Termux.

  4. ss-o commented on Aug 9, 2023

    @ss-o
    Member

    It seems to be a locale issue and encounters an escape sequence which most likely is not valid for currently set encoding. To verify this you may try:

    LC_ALL="UTF-8" echo '\u2603'
    LC_CTYPE="UTF-8" echo '\u2603'
    LC_CTYPE="en_US.UTF-8" echo "\u2603"

    The above should print a symbol or if due to missing fonts may provide empty/incorrect output, but no error should be shown, but with the following example it should show error "character not in range":

    LC_CTYPE="C" echo '\u2603'

    Could you please confirm that this is the case?

    Source related to locale: https://wiki.archlinux.org/title/locale

  5. asumbek commented on Aug 10, 2023

    @asumbek
    Author

    I tried above but still complain about character not in range.
    Screenshot_20230810-101858_Termux

  6. ss-o commented on Aug 10, 2023

    @ss-o
    Member

    Pretty sure that the error is shown because of the locale and multiple scenarios may cause this, e.g. lack of configuration, misconfiguration, corrupted files, etc.

    Try the following:

    Open the /etc/locale.gen file and ensure there is a line as below and it is not prepended with a #, then run locale-gen (usually requires root access and executed with sudo)

    en_US.UTF-8 UTF-8

    Add at the top of your .zshrc, then run exec zsh.

    export LANG=en_US.UTF-8
    export LC_ALL=en_US.UTF-8

    If the issue is not solved then check if it is caused by something in .zshrc:

    mv ~/.zshrc ~/.zshrc.backup
    touch ~/.zshrc
    exec zsh
    echo '\u2603'

    If the character not in range error does not appear then recover .zshrc with cp -i ~/.zshrc.backup ~/.zshrc and remove components one by one while each time running exec zsh and echo '\u2603' afterward to identify what exactly causes the error.

  7. asumbek commented on Aug 10, 2023

    @asumbek
    Author

    Oh now it works, seems like I haven't setup locale.

  8. locked and limited conversation to collaborators on Aug 10, 2023
  9. converted this issue into a discussion #279 on Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions