Giter Club home page Giter Club logo

Comments (12)

AndreRenaud avatar AndreRenaud commented on August 25, 2024 1

Yes, I'd seen that, but hadn't really worried about it too much. It's because I'm resetting a bunch of things when you reach the beginning of the history list, which includes where you're up to in the list. I've just pushed a minor tweak that restores that value (slight hack, ah well).

Want to try it now (on the #29 branch)?

from embeddedcli.

fizzyade avatar fizzyade commented on August 25, 2024 1

Yes, I'd seen that, but hadn't really worried about it too much. It's because I'm resetting a bunch of things when you reach the beginning of the history list, which includes where you're up to in the list. I've just pushed a minor tweak that restores that value (slight hack, ah well).

Want to try it now (on the #29 branch)?

Perfect, working as expected now! :)

from embeddedcli.

AndreRenaud avatar AndreRenaud commented on August 25, 2024 1

Great!

I'll close this issue, since it relates to things we've resolved. Let me know if you have any other problems.

Thanks for the report.

from embeddedcli.

AndreRenaud avatar AndreRenaud commented on August 25, 2024

Hi,
That seems like a pretty reasonable/easy requirement. Can you tell me if #28 works how you'd expect?

from embeddedcli.

fizzyade avatar fizzyade commented on August 25, 2024

Hi! It's early in the morning here so I will take a look later today, I was going to create a PR myself!

I'll let you know after I pull this in, many thanks for a fast reply!

from embeddedcli.

fizzyade avatar fizzyade commented on August 25, 2024

Hi,
That seems like a pretty reasonable/easy requirement. Can you tell me if #28 works how you'd expect?

Yes, I just tried it and that is indeed working! :)

However...I'm seeing an issue when going through the history, the issue occurs no matter what terminal I am using, basically it I type a few commands and then use up and down you can see that once I just the earliest entry and start going the other way, the history goes wrong and starts deleting part of prompt.

Now, my prompt does have ANSI escape sequences in it to colorise it, so I don't know if that's contributing to it. I need to take a look later on and see if I can see why this is happening, I have attached a GIF showing it happening and hopefully GitHub will show it.

History Prompt Eating

from embeddedcli.

AndreRenaud avatar AndreRenaud commented on August 25, 2024

I've just done a check in main, and I can still replicate this. So I don't think this is a result of this change. It looks like going up is ok, but when you go down the cursor ends up at the beginning of the line, not the end, then the next time you hit down it backspaces too far.

I'll have a look as well - please let me know if you find the cause.

from embeddedcli.

fizzyade avatar fizzyade commented on August 25, 2024

from embeddedcli.

AndreRenaud avatar AndreRenaud commented on August 25, 2024

Ah, I think I might have spotted it. This stuff is a bit hairy, and I realise now that this code if pretty poorly documented. The upshot is that if you reach the end of the history, it doesn't reset the buffer to empty, which means it backspaces over characters that it's not drawing.

Can you try this one? I'll merge the is_last stuff
#29

from embeddedcli.

fizzyade avatar fizzyade commented on August 25, 2024

Ah, I think I might have spotted it. This stuff is a bit hairy, and I realise now that this code if pretty poorly documented. The upshot is that if you reach the end of the history, it doesn't reset the buffer to empty, which means it backspaces over characters that it's not drawing.

Can you try this one? I'll merge the is_last stuff

#29

Thanks! I will check in a bit, going to have a good look at the code and see if I can add anything I think is missing!

from embeddedcli.

fizzyade avatar fizzyade commented on August 25, 2024

Ah, I think I might have spotted it. This stuff is a bit hairy, and I realise now that this code if pretty poorly documented. The upshot is that if you reach the end of the history, it doesn't reset the buffer to empty, which means it backspaces over characters that it's not drawing.

Can you try this one? I'll merge the is_last stuff #29

Ok, this has resolved the issue with the dissappearing prompt, however, moving through the history seems a bit weird, it seems to wrap around when you press up, but down behaves as I would expect (stopping at the end), this means that because it wraps going up, you can go past the start but then can't go back down since you get stuck, so you have to go all the way back around to the command you want going up.

I realise that I probably haven't explained that very well.

The behaviour I would expect is no matter which direction you go through the history that either the start or the end of the history should be a hard stop.

I'm going to have a look at the code and get acquainted with it!

I really appreciate your responses here, I know that writing open-source software can sometimes be a thankless task!

from embeddedcli.

fizzyade avatar fizzyade commented on August 25, 2024

Great!

I'll close this issue, since it relates to things we've resolved. Let me know if you have any other problems.

Thanks for the report.

You're welcome, many thanks for taking on board my suggestion and then fixing the subsequent issues I discovered!

Cool little library!

from embeddedcli.

Related Issues (4)

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.