aboutsummaryrefslogblamecommitdiffstats
path: root/commands/terminal/close.go
blob: 5d52bbc5811a12d52743f9bdbaf9399ba68f95b2 (plain) (tree)
1
2
3
4
5
6




                
                                    







                         
                                 


                                
                                               


                  
                                           


                                                 
                                                           
                    

                  
package terminal

import (
	"errors"

	"git.sr.ht/~rjarry/aerc/app"
)

type Close struct{}

func init() {
	register(Close{})
}

func (Close) Aliases() []string {
	return []string{"close"}
}

func (Close) Complete(args []string) []string {
	return nil
}

func (Close) Execute(args []string) error {
	if len(args) != 1 {
		return errors.New("Usage: close")
	}
	term, _ := app.SelectedTabContent().(*app.Terminal)
	term.Close()
	return nil
}