aaronjanse / 3mux

Terminal multiplexer inspired by i3
MIT License
1.82k stars 46 forks source link

report errors while detached #86

Closed aaronjanse closed 3 years ago

aaronjanse commented 4 years ago

Depends on #85.

main.go eventually needs to be refactored. In this PR:

Best way to test this is by applying the following diff to vterm/stdout.go

diff --git a/vterm/stdout.go b/vterm/stdout.go
index e6edf7c..7f49250 100644
--- a/vterm/stdout.go
+++ b/vterm/stdout.go
@@ -2,8 +2,10 @@ package vterm

 import (
        "bufio"
+       "fmt"
        "log"
        "sync/atomic"
+       "time"

        "github.com/aaronjanse/3mux/ecma48"
 )
@@ -64,6 +66,10 @@ func (v *VTerm) ProcessStdout(input *bufio.Reader) {
                                break
                        }

+                       if time.Now().Second() == 0 {
+                               panic(fmt.Errorf("FORCED"))
+                       }
+
                        // log.Printf(":: %q", output.Raw)

                        switch x := output.Parsed.(type) {

This is a draft PR until I test it a little more later tonight

aaronjanse commented 3 years ago

I'm currently writing a much much cleaner solution for error handling, where every err return value is checked during the boot process, with helpful error messages and manual exits instead of messy panics