Run on-quit when terminal closes (#1681)

This commit is contained in:
Joe Lim authored and GitHub committed 2024-04-07 15:47:49 +02:00
1 parent 63815aaa75
commit ce12116418
2 files changed
+8 -4

No files matched your search

+6
View File
@@ -580,6 +580,12 @@ func onSelect(app *app) {
}
}
func onQuit(app *app) {
if cmd, ok := gOpts.cmds["on-quit"]; ok {
cmd.eval(app, nil)
}
}
func splitKeys(s string) (keys []string) {
for i := 0; i < len(s); {
r, w := utf8.DecodeRuneInString(s[i:])