Skip to content

Commit

Permalink
fix(term): set terminal to raw
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed May 7, 2024
1 parent 39d8441 commit defd029
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion exp/term/examples/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ import (

func main() {
in, out := os.Stdin, os.Stdout
state, err := term.MakeRaw(in.Fd())
if err != nil {
log.Fatal(err)
}

hasKitty, _ := term.QueryKittyKeyboard(in, out)
log.Printf("Kitty keyboard support: %v", hasKitty)
bg, _ := term.QueryBackgroundColor(in, out)

if err := term.Restore(in.Fd(), state); err != nil {
log.Fatal(err)
}

log.Printf("Kitty keyboard support: %v", hasKitty)
log.Printf("Background color: %s", colorToHexString(bg))
}

Expand Down

0 comments on commit defd029

Please sign in to comment.