summary refs log tree commit diff stats
path: root/commands/term.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/term.go')
-rw-r--r--commands/term.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/commands/term.go b/commands/term.go
index 976ce29..1981e62 100644
--- a/commands/term.go
+++ b/commands/term.go
@@ -4,7 +4,6 @@ import (
 	"os/exec"
 	"time"
 
-	"git.sr.ht/~sircmpwn/aerc2/lib/ui"
 	"git.sr.ht/~sircmpwn/aerc2/widgets"
 
 	"github.com/gdamore/tcell"
@@ -27,14 +26,8 @@ func Term(aerc *widgets.Aerc, args []string) error {
 	if err != nil {
 		return err
 	}
-	grid := ui.NewGrid().Rows([]ui.GridSpec{
-		{ui.SIZE_WEIGHT, 1},
-	}).Columns([]ui.GridSpec{
-		{ui.SIZE_EXACT, aerc.Config().Ui.SidebarWidth},
-		{ui.SIZE_WEIGHT, 1},
-	})
-	grid.AddChild(term).At(0, 1)
-	tab := aerc.NewTab(grid, args[1])
+	host := widgets.NewTermHost(term, aerc.Config())
+	tab := aerc.NewTab(host, args[1])
 	term.OnTitle = func(title string) {
 		if title == "" {
 			title = args[1]
@@ -43,7 +36,7 @@ func Term(aerc *widgets.Aerc, args []string) error {
 		tab.Content.Invalidate()
 	}
 	term.OnClose = func(err error) {
-		aerc.RemoveTab(grid)
+		aerc.RemoveTab(host)
 		if err != nil {
 			aerc.PushStatus(" "+err.Error(), 10*time.Second).
 				Color(tcell.ColorRed, tcell.ColorWhite)