func events(w *acme.Win) <-chan string { c := make(chan string, 10) go func() { for e := range w.EventChan() { switch e.C2 { case 'x', 'X': // execute if string(e.Text) == "Del" { w.Ctl("delete") } w.WriteEvent(e) case 'l', 'L': // look w.Ctl("clean") c <- string(e.Text) } } w.CloseFiles() close(c) }() return c }