From 7a65c024953baf36b3fd866bdca50623a763fae1 Mon Sep 17 00:00:00 2001 From: Zhi Wang Date: Fri, 14 Jan 2022 17:16:06 -0500 Subject: [PATCH] WIP --- cmd/replay/replay.go | 9 ++------- cmd/replay/run.sh | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cmd/replay/replay.go b/cmd/replay/replay.go index 8bddcfb..dd1c439 100644 --- a/cmd/replay/replay.go +++ b/cmd/replay/replay.go @@ -2,7 +2,6 @@ package main import ( "encoding/json" - "fmt" "io" "log" "os" @@ -38,15 +37,11 @@ func main() { log.Fatalln("Failed to create terminal") } - w, h, err := term.GetSize(int(os.Stdout.Fd())) + w, h, _ := term.GetSize(int(os.Stdout.Fd())) if (w != 120) || (h != 36) { - fmt.Println("Set terminal window to 120x36") - os.Stdout.WriteString(`\e[8;50;100t`) + log.Fatalln("Set terminal window to 120x36 before continue") } - /* if err := term.SetSize(120, 36); err != nil { - log.Println("Failed to set terminal size", err) - } */ decoder := json.NewDecoder(fp) diff --git a/cmd/replay/run.sh b/cmd/replay/run.sh index b8aa699..c98468c 100755 --- a/cmd/replay/run.sh +++ b/cmd/replay/run.sh @@ -1,4 +1,4 @@ echo "Try to resize shell with shell command" printf '\e[8;36;120t' clear -./replay $1 \ No newline at end of file +$(dirname $0)/replay $1 \ No newline at end of file