12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394open!Coremoduletype%template[@modality(p,c)=((nonportable,uncontended),(portable,contended))]Io=sigtype'attype'afmttypeout_channel:valuemodcpincludeMonad.Swithtype'at:='atvaloutput_string:out_channel->string->unitvaloutput:out_channel->buf:bytes->pos:int->len:int->unitvalstderr:out_channelvalstdout:out_channelvalflush:out_channel->unittvalprint_string:string->unitvalfprintf:attrs:string->out_channel->'afmt->'avalfold_left:'aList.t->init:'b->f:('b->'a->'bt)->'btvalstdout_isatty:unit->booltvalcapable:unit->booltendmoduletypeS=sigtype'aiotype'aio_fmttypeout_channel(** Handling of ansi codes. *)moduleAnsi:sigvalkill_line:unit->unitvalerase_to_end_of_screen:unit->unitvalerase_to_start_of_screen:unit->unitvalerase_all:unit->unitvalbell:unit->unitvalhome:unit->unitvalhome_cursor:unit->unitvalcursor_up:unit->unitvalcursor_down:unit->unitvalcursor_backward:unit->unitvalcursor_forward:unit->unitvalsave_cursor:unit->unitvalunsave_cursor:unit->unittypeattr=Ansi_kernel.Attr.t(** [printf] and [eprintf] do not emit OSC 8 hyperlink escapes: any [`Url _]
attributes in [style] are silently dropped. Use [string_with_attr] or
[output_string] if you need hyperlink support. *)valprintf:attrlist->'aio_fmt->'avaleprintf:attrlist->'aio_fmt->'a(** [output_string] and [output] honor [`Url _] attrs by wrapping the output in OSC 8
hyperlink escapes when the terminal is color-capable. *)valoutput_string:attrlist->out_channel->string->unitiovaloutput:attrlist->out_channel->Bytes.t->int->int->unitio(** Create a string with embedded SGR and OSC 8 formatting codes.
See {!Ansi_kernel.Attr.t} for the semantics of each attribute; in particular,
[`Url _] wraps [string] in an OSC 8 hyperlink escape.
Raises if the URL contains control characters. *)valstring_with_attr:attrlist->string->string@@portableendvalis_color_tty:unit->boolio(** The width in characters of the current output. Returns [`Not_a_tty] if stdout is not
connected to a tty. *)valwidth:unit->[`Colsofint|`Not_a_tty|`Not_available]io(** print a list in a columnize way (like the output of ls) *)valprint_list:out_channel->(string*Ansi.attrlist)list->unitioend(** Color printing in terminals *)moduletypeConsole=sig@@portablemoduletypeIo=IomoduletypeS=Smodule%template.portable[@modalityp]Make(Io:Io[@modalityp]):Swithtype'aio:='aIo.tandtype'aio_fmt:='aIo.fmtandtypeout_channel:=Io.out_channelincludeSwithtype'aio:='aandtype'aio_fmt:=('a,Out_channel.t,unit)formatandtypeout_channel:=Out_channel.tend