aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

close.go (352B)


      1 package terminal
      2 
      3 import (
      4 	"errors"
      5 
      6 	"git.sr.ht/~sircmpwn/aerc/widgets"
      7 )
      8 
      9 func init() {
     10 	register("close", CommandClose)
     11 }
     12 
     13 func CommandClose(aerc *widgets.Aerc, args []string) error {
     14 	if len(args) != 1 {
     15 		return errors.New("Usage: close")
     16 	}
     17 	term, _ := aerc.SelectedTab().(*widgets.Terminal)
     18 	term.Close(nil)
     19 	aerc.RemoveTab(term)
     20 	return nil
     21 }