[GH-ISSUE #847] How to access Custom Events from the Event Loop? #617

Closed
opened 2026-03-04 01:06:29 +03:00 by kerem · 4 comments
Owner

Originally created by @devppratik on GitHub (May 9, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/847

The tcell-term is a library based on tcell. At the moment, it has a custom event that determines if the terminal has exited or not.
How do I access this event in tview?
Is there a way to call this event and then use it in the application?

Originally created by @devppratik on GitHub (May 9, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/847 The [tcell-term](https://git.sr.ht/~rockorager/tcell-term) is a library based on tcell. At the moment, it has a custom event that determines if the terminal has exited or not. How do I access this event in tview? Is there a way to call this event and then use it in the application?
kerem closed this issue 2026-03-04 01:06:29 +03:00
Author
Owner

@devppratik commented on GitHub (May 10, 2023):

I figured out I can queue a event using the QueueEvent function but how do I access the event from the app event loop itself??

<!-- gh-comment-id:1542228236 --> @devppratik commented on GitHub (May 10, 2023): I figured out I can queue a event using the QueueEvent function but how do I access the event from the app event loop itself??
Author
Owner

@rivo commented on GitHub (Jun 18, 2023):

There is currently no way to do this. Can you provide some context? What do you want to achieve with these custom events?

<!-- gh-comment-id:1596116523 --> @rivo commented on GitHub (Jun 18, 2023): There is currently no way to do this. Can you provide some context? What do you want to achieve with these custom events?
Author
Owner

@devppratik commented on GitHub (Jul 3, 2023):

There is currently no way to do this. Can you provide some context? What do you want to achieve with these custom events?

@rivo @digitallyserviced
https://git.sr.ht/~rockorager/tterm is a library based on https://git.sr.ht/~rockorager/tcell-term for t view.

This allows to use a terminal as a view for tview. It works quite well and without any issues.
I am trying to create a TMux sort of application using this library

However, when the shell exits (e.g. the user typed user) tcell-term emits a EventClosed event to let the user know that the terminal has exited. I would like to capture the EventClosed in tview and then perform a set of actions accordingly.

<!-- gh-comment-id:1617963577 --> @devppratik commented on GitHub (Jul 3, 2023): > There is currently no way to do this. Can you provide some context? What do you want to achieve with these custom events? @rivo @digitallyserviced https://git.sr.ht/~rockorager/tterm is a library based on https://git.sr.ht/~rockorager/tcell-term for t view. This allows to use a terminal as a view for tview. It works quite well and without any issues. I am trying to create a TMux sort of application using this library However, when the shell exits (e.g. the user typed user) tcell-term emits a `EventClosed` event to let the user know that the terminal has exited. I would like to capture the `EventClosed` in tview and then perform a set of actions accordingly.
Author
Owner

@devppratik commented on GitHub (Jul 4, 2023):

This really solved what I wanted to do!
Thanks!!

<!-- gh-comment-id:1620629630 --> @devppratik commented on GitHub (Jul 4, 2023): This really solved what I wanted to do! Thanks!!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#617
No description provided.