Remove cleanup function that complicated debuging
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
This commit is contained in:
parent
ca2fcdbede
commit
5f81aa90a1
13
gilo.go
13
gilo.go
@ -1,26 +1,15 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"golang.org/x/term"
|
|
||||||
"os"
|
"os"
|
||||||
"timshome.page/gilo/editor"
|
"timshome.page/gilo/editor"
|
||||||
"timshome.page/gilo/terminal"
|
"timshome.page/gilo/terminal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func cleanup(oldState *term.State) {
|
|
||||||
defer terminal.RawOff(oldState)
|
|
||||||
|
|
||||||
// Recover from panic to allow restoring terminal state
|
|
||||||
if a := recover(); a != nil {
|
|
||||||
fmt.Println("RECOVER", a)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Go to proper raw mode, but restore canonical mode at exit
|
// Go to proper raw mode, but restore canonical mode at exit
|
||||||
oldState := terminal.RawOn()
|
oldState := terminal.RawOn()
|
||||||
defer cleanup(oldState)
|
defer terminal.RawOff(oldState)
|
||||||
|
|
||||||
e := editor.NewEditor()
|
e := editor.NewEditor()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user