Giter Site home page Giter Site logo

bira's Issues

Autocompletion duplicates first characters of line

Prerequisites

  • I've checked the existing issues and I'm not duplicating a report.
  • I've checked the zimfw Changelog and I'm not being affected by documented changes.
  • I've checked the zimfw 📢 Announcements and I'm not being affected by announced changes.

Bug description

Hello,
When I use the autocompletion feature with the bira theme, the first characters will be duplicated and the cursor is misplaced. This only happen, if I need to hit TAB twice. If the word to complete is not ambiguous everything is fine.

The cursor also is misplaced, when the executed command returns an error. For example, when just type test or use Ctrl+C.

Steps to reproduce

  1. cd ${$(mktemp -d):A} && \
        ZDOTDIR=${PWD} HOME=${PWD} ZIM_HOME=${PWD}/.zim && \
        curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh && \
        exec zsh
    
  2. change theme in .zimrc to bira
  3. Type echo $P and hit TAB twice produces:
╭─user@machine ~
╰─$ echoecho $PS1
-- parameter --
PAGER              PPID               PROMPT             PROMPT3            PS1                PS3                PSVAR              parameters         path               precmd_functions   prompt           
PATH               PROFILEHOME        PROMPT2            PROMPT4            PS2                PS4                PWD                patchars           pipestatus         preexec_functions  psvar

Note the echoecho at the beginning
After execution everything I fine again, if command returns without error.

If execution failed, I get:

╭─user@machine ~
╰─$                                                                                                                                                                                                127 ↵
  ^
cursor is here

So the cursor is inside the $ and the line behaves more strange.

Current behavior

The first four characters of the autocompleted line will be duplicated.

When commands execution failed before the input of npm inst and TAB twice will produce:

╭─user@machine ~
╰─npm innpm install                                                                                                                                                                                                      254 ↵
insta            instal           install          install-ci-test  install-clean    install-test

While the cursor is inside the s of install and all is from my history, I think.

Expected behavior

No duplication of the first characters.
No strange behavior of command line, when use auto completion even after a command failed before.

zimfw info

╭─user@machine ~
╰─$ zimfw info
zimfw version:        1.12.1 (built at 2023-09-16 18:25:16 UTC, previous commit is 26151d2)
LANG:                 de_DE.UTF-8
OSTYPE:               linux-gnu
TERM:                 xterm-256color
TERM_PROGRAM:         
TERM_PROGRAM_VERSION: 
ZIM_HOME:             /home/user/.zim
ZSH_VERSION:          5.8

Additional context

Using the theme steeef let me use autocompletion as intended.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.