Kitty Graphics Protocol in OCaml
terminal
graphics
ocaml
1(* Kitty Graphics Protocol Detection - Implementation *)
2
3let make_query () =
4 let cmd =
5 Kgp_command.query ~format:`Rgb24 ~transmission:`Direct ~width:1 ~height:1 ()
6 in
7 Kgp_command.to_string cmd ~data:"\x00\x00\x00"
8
9let supports_graphics response ~da1_received =
10 response
11 |> Option.map Kgp_response.is_ok
12 |> Option.value ~default:(not da1_received)