From 8f1eacab879e59b31f45bd0eba5f05107971408e Mon Sep 17 00:00:00 2001 From: aoife cassidy Date: Sun, 19 Jan 2025 12:32:59 +0200 Subject: [PATCH] hackiest fix of the CENTURY omlord --- app/editor.go | 7 ++++--- app/shell.go | 3 ++- ui/ui.go | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/editor.go b/app/editor.go index 450022e..81fd097 100644 --- a/app/editor.go +++ b/app/editor.go @@ -2,6 +2,7 @@ package app import ( "fmt" + "os" "os/exec" "os/user" @@ -52,11 +53,11 @@ like before, when you're done, type `}, } func (view *Editor) Event(state *ui.State, event vaxis.Event) (processed bool) { - win := state.Window() + win := state.Window().New(0, 16, 80, 80) view.Draw(state) vt := term.New() - vt.Draw(win.New(0, 16, 80, 80)) + vt.TERM = os.Getenv("TERM") vt.Attach(state.PostEvent()) vt.Focus() err := vt.Start(exec.Command("bash", "-l")) @@ -76,7 +77,7 @@ func (view *Editor) Event(state *ui.State, event vaxis.Event) (processed bool) { return case vaxis.Redraw: view.Draw(state) - vt.Draw(win.New(0, 16, 80, 80)) + vt.Draw(win) state.Render() continue } diff --git a/app/shell.go b/app/shell.go index 7126d69..9dab03f 100644 --- a/app/shell.go +++ b/app/shell.go @@ -1,6 +1,7 @@ package app import ( + "os" "os/exec" "git.sr.ht/~rockorager/vaxis" @@ -47,7 +48,7 @@ func (view *Shell) Event(state *ui.State, event vaxis.Event) (processed bool) { view.Draw(state) vt := term.New() - vt.Draw(win) + vt.TERM = os.Getenv("TERM") vt.Attach(state.PostEvent()) vt.Focus() err := vt.Start(exec.Command("bash", "-l")) diff --git a/ui/ui.go b/ui/ui.go index a7b35e1..1989035 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -15,7 +15,7 @@ type View interface { var Events = make(chan vaxis.Event) var Quit = make(chan struct{}) -var ViewChange = make(chan View, 1) +var ViewChange = make(chan View, 10) type State struct { content View