This commit is contained in:
Zhi Wang 2022-01-14 17:16:06 -05:00
parent aee1251238
commit 7a65c02495
2 changed files with 3 additions and 8 deletions

View File

@ -2,7 +2,6 @@ package main
import ( import (
"encoding/json" "encoding/json"
"fmt"
"io" "io"
"log" "log"
"os" "os"
@ -38,15 +37,11 @@ func main() {
log.Fatalln("Failed to create terminal") 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) { if (w != 120) || (h != 36) {
fmt.Println("Set terminal window to 120x36") log.Fatalln("Set terminal window to 120x36 before continue")
os.Stdout.WriteString(`\e[8;50;100t`)
} }
/* if err := term.SetSize(120, 36); err != nil {
log.Println("Failed to set terminal size", err)
} */
decoder := json.NewDecoder(fp) decoder := json.NewDecoder(fp)

View File

@ -1,4 +1,4 @@
echo "Try to resize shell with shell command" echo "Try to resize shell with shell command"
printf '\e[8;36;120t' printf '\e[8;36;120t'
clear clear
./replay $1 $(dirname $0)/replay $1