Resizing problems when importing readline
#4465
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
We found the following entry in the FAQ which you may find helpful: Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review. This is an automated reply, generated by FAQtory |
Beta Was this translation helpful? Give feedback.
-
|
You might want to consider running your application from the Textual app with a worker. Alternatively you could use a subprocess for your main application. Allow the Textual app to respond to stdin and stdout. Consider using the asyncio subprocess API for that. I'm guessing the readline issue is caused by readline handling the terminal resize signal. The |
Beta Was this translation helpful? Give feedback.
-
|
I have noticed readline only breaks resizing when imported in a libVTE terminal (e.g. gnome-terminal), not in VSCode's built in terminal. In my case the import is from a click extension library (I use a click CLI to launch the app either as the Textual interface or a plainer one). I can patch the library to work around this, but I wonder if there is a better solution. Is Textual using SIGWINCH to detect resizes? If so I think this is being caused by python/cpython#46927. There is a patch available that should fix it. |
Beta Was this translation helpful? Give feedback.





You might want to consider running your application from the Textual app with a worker. Alternatively you could use a subprocess for your main application. Allow the Textual app to respond to stdin and stdout. Consider using the asyncio subprocess API for that.
I'm guessing the readline issue is caused by readline handling the terminal resize signal. The
readlinemodule doesn't really make sense in the same context as a Textual app.