Coder Social home page Coder Social logo

Comments (10)

MrDaGree avatar MrDaGree commented on June 15, 2024 1

It can be modified outside of a Console object, which makes knowing how to "reset" it next to impossible.

In my project I'm not modifying the cursor at all. I've only used status, Live tables, and progress bars. I'd expect for using things the correct way it surely can manage its cursor itself.

from rich.

github-actions avatar github-actions commented on June 15, 2024

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

from rich.

nineteendo avatar nineteendo commented on June 15, 2024

For reference, here's how I handled this in my own library: https://github.com/nineteendo/ansio/blob/125577e28362ed5395c3dafed38df763fa88b8c2/ansio/__init__.py

from rich.

MrDaGree avatar MrDaGree commented on June 15, 2024

is there any updates to this?

from rich.

nineteendo avatar nineteendo commented on June 15, 2024

Nope, this is one of the reasons why I don't use rich.

from rich.

willmcgugan avatar willmcgugan commented on June 15, 2024

The cursor state is something managed by the terminal. It can be modified outside of a Console object, which makes knowing how to "reset" it next to impossible. Additionally, to detect the cursor state, you would need to capture stdin, which Rich doesn't do as it would break the many project that do capture stdin.

If you want control over the cursor state, put it in a try / finally, or a context manager.

from rich.

github-actions avatar github-actions commented on June 15, 2024

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

from rich.

nineteendo avatar nineteendo commented on June 15, 2024

to detect the cursor state, you would need to capture stdin

Can I detect that without using ansi escape codes? My library will always show the cursor on exit if you chose to hide it.

from rich.

willmcgugan avatar willmcgugan commented on June 15, 2024

Don't call input when any of these objects are running. Input will block and write to the terminal at the same time as Rich, and there is no way for Rich to detect this.

If you want a UI where you can get user input and update the screen, look in to a TUI framework like Textual.

from rich.

MrDaGree avatar MrDaGree commented on June 15, 2024

When status, Live tables, or progress bars are shown there is no input being captured. In the case of status and the progress bars its being used for long waiting tasks to show that something is happening than just a blank terminal

from rich.

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.