Open candidtim opened 9 months ago
Hi There
Thanks for your your question.
For the first question, I've to investigate it. Probably not, because it is not known for Textual, that a command inside the terminal widget has been run.
For the second question, possibly yes, if the command you've defined stopped. This should already trigger some Message from Textual itself. If it would be a command inside a widget running bash, probably not. That would be the same as above.
As soon as I've some spare time, I'll investigate it.
Mitosch
I have looked into the source code and it seems that a call to the post_message
can be added to the Terminal.stop()
method. I have made a simple test by extending the class and it seems to work fine. Let me know if you accept Pull Requests, I can prepare one, maybe even with some niceties to parse the exit code to raise in the message.
Yes, that would also be my idea for the second usecase. If that is, what you need, just make a pull request.
I'd be happy to merge it and release a new version.
As it might be related to this: #8
Is there a way to know (a Message?) when a command running in the terminal terminates? Or, put differently, when a terminal stops?