Code Monkey home page Code Monkey logo

Comments (7)

iamsauravsharma avatar iamsauravsharma commented on May 18, 2024 1

I have tried to solve out this issue by modifying out ANSIString and wrap non-printing character escape for all of ansi-term addition parts in my fork branch-link. I have checked this for bash shell and it seems to work properly for bash not yet tried for zsh. I think there is no issue for fish non printing character count if I am right. If solution is good to go and works for all shell I will create out PR #183

from starship.

matchai avatar matchai commented on May 18, 2024

Great find, @chipbuster! 😄

Sorry about all the bug reports I've been generating recently!

Don't be! We need hawk-eyed people around to help catch these bugs. I use starship as my daily-driver, but only on Fish. My visibility over these issues is limited. 😅

I'd be curious to find out if this issue occurs on other dynamic colored prompts. I'll be experimenting to see if maybe this is an underlying issue in zsh rather than something to do with the prompt itself. In https://github.com/matchai/spacefish we have had similar issues that were eventually solved with newly added configuration in fish.

the color codes are coming from the ANSI library, and I don't see a way to tell the library to wrap the escape codes in a shell-specific escape sequence.

ansi_term is a pretty light library. If need be, we could create a PR or fork it to add the functionality needed for starship to work correctly.

from starship.

chipbuster avatar chipbuster commented on May 18, 2024

I'd be curious to find out if this issue occurs on other dynamic colored prompts.

By that do you mean any prompt that's dynamically generated or specifically one generated outside the shell?

While searching around, I definitely stumbled over some bugs involving this in the early years of oh-my-zsh and zprezto, but they were almost always solved by proper application of %{ and %} to the prompt generation functions.

from starship.

saghm avatar saghm commented on May 18, 2024

Seems like this ansi-term issue is due to the same underlying issue (only in bash): ogham/rust-ansi-term#36

from starship.

xbb avatar xbb commented on May 18, 2024

@iamsauravsharma your solution seems to work fine with zsh, thanks.

from starship.

bhearsum avatar bhearsum commented on May 18, 2024

I'm still experiencing this issue on 0.13.1 with oh-my-zsh:
https://asciinema.org/a/5J7BtDkoMnMDZb7fzNbcZp9Nx

(If I should open a new issue for this, please let me know.)

from starship.

chipbuster avatar chipbuster commented on May 18, 2024

@mozbhearsum Go ahead and open an issue (mostly because it's going to get lost if it stays here--I almost forgot to respond to this).

Does tab-completion appear to work correctly for you or is that broken as well? And is this taking place within a dockerized environment?

from starship.

Related Issues (20)

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.