Git Product home page Git Product logo

Comments (6)

op3 avatar op3 commented on June 2, 2024

What is your operating system, python version (e.g., run python --version) and prompt_toolkit version (e.g., run python -c "import prompt_toolkit; print(prompt_toolkit.__version__)")?

from hdtv.

antosaracino avatar antosaracino commented on June 2, 2024

Hi, I have exactly the same issue described above. I am running on Ubuntu 22.04.3 LTS, with ROOT 6.28.10 (but I also tried previous releases). My python version is 3.10.12 and prompt_toolkit version is 3.0.43. Could you help me please?

from hdtv.

janmayer avatar janmayer commented on June 2, 2024

I could reproduce the issue - in SimpleUI print, the event loop is not running when call_soon_threadsafe is called (or at least something like that).

        hdtv.cmdline.command_line.loop.call_soon_threadsafe(
            self.print_patched, HTML(html), end
        )

Im not sure what the loop is for - I see only few usages. The commented out self.print_patched(HTML(html), end) seems to work.

@op3, do you remember the specifics of Add support for prompt_toolkit 3.0 (asyncio)?

from hdtv.

antosaracino avatar antosaracino commented on June 2, 2024

Thanks! Indeed commenting out that line, everything seems to work.

from hdtv.

op3 avatar op3 commented on June 2, 2024

I have not managed to reproduce this exact issue yet. However, I can trigger the same behavior by entering and exiting a python shell in hdtv (execute python inside hdtv and then exit() it again) (thanks to @j-kleemann for noticing this).

I think I had similar problems (no output) when I ported the code to prompt_toolkit 3.0 in e4d18ca before introducing call_soon_threadsafe, but I don’t remember the specifics.

Edit: I can reproduce the problem using our docker image

from hdtv.

op3 avatar op3 commented on June 2, 2024

The problem should be fixed now. Printing also works after entering and leaving an ipython shell inside hdtv.

When closing hdtv using the close button of the graphical window, we have to make sure that the event loop is stopped before ROOT exits. For this, we need an event loop that can be addressed. Because the behavior of prompt_toolkit changed, this event loop was never started. We now manually create a dedicated thread to run the event loop. Printing works, and exiting hdtv both from the terminal and the GUI works (without segfaulting).

from hdtv.

Related Issues (10)

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.