Page 1 of 1

RenPyTerminal

Posted: Mon Apr 14, 2025 1:35 am
by Andredron
https://github.com/nm17/renpyterminal?t ... me-ov-file

A powerful terminal plugin for RenPy that supports VT100/ANSI escape codes.

Based upon the pyte Python library. It's not included in the code for legal reasons. You need to install it by calling:

pip install --target game/python-packages pyte
This repo is not just the library itself. It's a demo RenPy game that contains the library itself (most of the files are in game/terminal).

Sidenote: contact me on Discord if you want to help with the code (Nick: nvrm17, thanks in advance!)...
Or you can also send patches to me by email :p

Re: RenPyTerminal

Posted: Mon Apr 14, 2025 10:20 am
by jeffster
Andredron wrote: Mon Apr 14, 2025 1:35 am A powerful terminal plugin for RenPy that supports VT100/ANSI escape codes.
Impressive!

I can imagine using that in a game teaching programming or something.

Does it allow selecting and copying any text in the terminal? That's one functionality I miss in Console.

Re: RenPyTerminal - current status of the project

Posted: Thu Apr 17, 2025 3:20 pm
by nm17
Hello to you all, I'm the author of the code.

Currently, it's more of a proof of concept, since it has many issues and I don't have the spare time to fix them (busy with exams and whatnot). If you like the idea of the project - your best way to support would be to help out with some of the issues that are available in the main repo link: https://git.dc09.ru/nm17/renpyterminal (See the issues tab).

There are a lot of them, but #6 "Spawn command handlers in a separate thread" is the main one right now. This is important, as even "fake" commands done through the command handler might call time.sleep, which blocks the currently running thread (which was the UI thread before I changed that in commit 851305a1b5). This is not enough though, as it suffers from some kind of a race condition (didn't have the time to debug it yet)

One thing to keep in mind is that this is a real terminal, it's not a bunch of monospaced text with a text input at the end of it. "Programs" can edit the terminal in any way they like using escape sequences, and the screen is treated as a grid with rows and columns of cells. My end goal is to mimic how real modern terminals and shells operate, and to support running any kind of terminal UI in it, even real programs (I have an idea of integrating apps written with something like https://ratatui.rs in order to enhance the immersion).

Also, I have auto updating documentation and an internal API reference available at https://renpyterminal.readthedocs.io/en/latest/ . It is also WIP, but it still should be helpful to anyone who is willing to help out with the code.

P.S. I'm also sorry that the git repo is just a mirror of the repo on Forgejo, but I really have my reasons to hate GitHub. If anyone is really willing to help out with this project, I can create a user on this instance for you without any problems, so that we could speed up the development process. You can also send pull requests on GitHub, it's not big deal.

Re: RenPyTerminal

Posted: Thu Apr 17, 2025 3:25 pm
by nm17
jeffster wrote: Mon Apr 14, 2025 10:20 am Impressive!

I can imagine using that in a game teaching programming or something.
Thank you! It definitely might be useful in that regard, even if the main focus is to integrate it into a mod.
jeffster wrote: Mon Apr 14, 2025 10:20 am Does it allow selecting and copying any text in the terminal? That's one functionality I miss in Console.
No, sadly. I haven't gotten around to doing QoL changes like that, given the state of this project (see my reply before this one). I will gladly do it though, if I have the chance.