Revert "add close command at global level"
This reverts commit f0a0c5aa73
.
This commit is contained in:
parent
f0a0c5aa73
commit
4fc6fee734
6 changed files with 100 additions and 72 deletions
commands/terminal
30
commands/terminal/close.go
Normal file
30
commands/terminal/close.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package terminal
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"git.sr.ht/~sircmpwn/aerc/widgets"
|
||||
)
|
||||
|
||||
type Close struct{}
|
||||
|
||||
func init() {
|
||||
register(Close{})
|
||||
}
|
||||
|
||||
func (_ Close) Aliases() []string {
|
||||
return []string{"close"}
|
||||
}
|
||||
|
||||
func (_ Close) Complete(aerc *widgets.Aerc, args []string) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ Close) Execute(aerc *widgets.Aerc, args []string) error {
|
||||
if len(args) != 1 {
|
||||
return errors.New("Usage: close")
|
||||
}
|
||||
term, _ := aerc.SelectedTab().(*widgets.Terminal)
|
||||
term.Close(nil)
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue