summary refs log tree commit diff stats
path: root/widgets/terminal.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-11 14:15:29 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-11 14:15:29 -0400
commit71c13c907873d603bf15d68ab0372b75b271d18d (patch)
tree8d30b8b8c9c2679f37a4f29e702764fb99100d67 /widgets/terminal.go
parent72e4b5e2b2e0de50b8572f195f73ccdd8e9d9461 (diff)
downloadaerc-71c13c907873d603bf15d68ab0372b75b271d18d.tar.gz
"Press any key to close" for completed processes
Diffstat (limited to 'widgets/terminal.go')
-rw-r--r--widgets/terminal.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/widgets/terminal.go b/widgets/terminal.go
index 63c105f..92736d5 100644
--- a/widgets/terminal.go
+++ b/widgets/terminal.go
@@ -104,6 +104,7 @@ type Terminal struct {
 	vterm       *vterm.VTerm
 
 	OnClose func(err error)
+	OnEvent func(event tcell.Event) bool
 	OnStart func()
 	OnTitle func(title string)
 }
@@ -354,6 +355,11 @@ func convertMods(mods tcell.ModMask) vterm.Modifier {
 }
 
 func (term *Terminal) Event(event tcell.Event) bool {
+	if term.OnEvent != nil {
+		if term.OnEvent(event) {
+			return true
+		}
+	}
 	if term.closed {
 		return false
 	}