-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Textual improvements #520
Comments
Just to chime in, I frequently change Emacs and CLI theme using pywal, like multiple times a day. It's a bit frustrating that the new Textual UI doesn't pick up the theme the rest of my CLI is using and I have burned my retinas twice already today :) (Mildly related I would love to have a |
@CarlQLange Thanks for the feedback. You might already know this but as a quick fix you can change the theme by putting It seems in general like it's a hard problem to detect and match the user's terminal theme. It'd probably be good if we could at least serve dark mode if their bg color is darker than some threshold. I like the idea of |
I don't know enough about Textual really, but I guess I'm surprised there isn't a way to just 'passthrough' to the terminal's set colours. Anyway - very interesting link to nvim. I think that would fit the bill quite nicely - what I really want is to implement a frontend (or 'porcelain') for mentat in Emacs. It would potentially also be nice to be able to drive mentat from shell scripts. For example I might need to convert docker-compose files into kubernetes yaml in 50 repos. Mentat does quite a good job of this but I wish I could just write the instructions once and run it over each repo. |
Following up on the colour theme stuff: I've had a peruse of the Textual documentation and it definitely doesn't seem like what I'm asking for will be easy and would require some work on Textual directly. Bit of a strange decision on Textual's part imho. |
There is an issue though - some of the text colour is affected by my theme, so contrast is all over the place depending on my pywal theme. textual-2024-02-14_17.27.50.mp4 |
@CarlQLange there is the python_client which you could use to build a front end. We should probably document it a bit better. I just use it for testing right now which you can see a few places in the codebase. Thanks for sharing the video. That is strange. |
I agree; I was looking into it when I was trying to do exactly what you're asking for and I couldn't find any way to do it. Definitely annoying that textual doesn't have this built in.
Unfortunately there's no way for us to do anything with user selected terminal colors. Thanks for taking the time to submit your feedback! I definitely knew these would be issues coming in, although I still don't think there's any way to fix them, but I'll definitely still keep thinking about. |
Other textual issues/improvements: It seems like mentat uses quite a lot of CPU now - when it's streaming, it maxes out one of my cores. Related, it seems to stream characters a lot slower (and use more CPU) when there is a large chat - not even that large, two or three hundred lines will do it.
|
@CarlQLange you probably can copy paste: https://textual.textualize.io/FAQ/ |
I'm actually working on fixing this; the reason this happens is because every time text is added I just add it to the main content widget and update it; of course, this is n^2 on the length of the content (because strings are immutable). Unfortunately, it's more complicated than just creating new widgets for every bit of text and adding them on. There should be a way to fix it though, and hopefully I can figure it out soon. |
@PCSwingle Yeah, I took some time yesterday to see if I could use Textual's built-in RichLog widget instead, but it expects every write to be a line, and implementing a line buffer was too much hassle for me. I also don't know how it would impact the formatting. |
As discussed here #502 (review):
The text was updated successfully, but these errors were encountered: