Giter Site home page Giter Site logo

Comments (4)

IlanCosman avatar IlanCosman commented on May 17, 2024

Obviously you're right. This is the strangest bug I've encountered in a long while, more to follow when I figure it out 😂I'll give you a sneak peak though, try out the Lean style, the status item works perfectly there. It seems to have something to do with the prompt_char item.

from tide.

markstos avatar markstos commented on May 17, 2024

An unexpected trigger. You'll have to add more config details to tide bug-report in there are more config-specific bugs.

from tide.

IlanCosman avatar IlanCosman commented on May 17, 2024

I still don't really understand why my changes fixed this. I'll look more into it. Thanks for submitting this bug report 😄

from tide.

IlanCosman avatar IlanCosman commented on May 17, 2024

Okay, I get it now. Mostly putting this here for me in the future, but you too if you're interested.

I was only refreshing the prompt when the left_prompt_var changed. This made perfect sense to me, as the right_prompt_var is always changed before the left, thus we can do one refresh instead of two. The (in retrospect) obvious problem is that sometimes I change the right prompt without changing the left, causing the prompt not to update when it should. There were a number of factors concealing this problem however.

First is the fact that when the prompt is two lines, updating the "right prompt" status is is actually updating the left_prompt_var because of the way that multi-line right prompt works. So when the prompt is two lines, the bug won't appear.

Secondly, the prompt_char item, which is always in the left prompt, and also responds to changes in the previous status by turning from green to red if the status was anything but 0. Thus, if the previous status was 0, and then we run a non-existent command, everything seems fine because the left prompt_char changed to red and the right prompt status changed to 127. However, if our previous status wasn't 0, then the left prompt_char would already be red. Then, when we run a non-existent command the prompt won't refresh because the --on-variable handler only triggers when the variable is actually changed, and our left_prompt_var stayed the same.

So basically the only way to see the bug easily was a single-line prompt that doesn't have the prompt_char item, and I guess I just didn't spend enough time with those 😂

from tide.

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.