mirror of
https://github.com/urbit/shrub.git
synced 2024-12-15 04:22:48 +03:00
116 lines
7.5 KiB
Plaintext
116 lines
7.5 KiB
Plaintext
::
|
|
:::: /hook/core/console/sur
|
|
!:
|
|
|%
|
|
++ console-action :: console to app
|
|
$% :: [%abo ~] :: reset interaction
|
|
[%det console-change] :: command line edit
|
|
[%ret ~] :: submit and clear
|
|
== ::
|
|
++ console-buffer (list ,@c) :: command state
|
|
++ console-change :: network change
|
|
$: ler=console-clock :: destination clock
|
|
haw=@uvH :: source hash
|
|
ted=console-edit :: state change
|
|
== ::
|
|
++ console-dialog :: standard dialog
|
|
|* out=$+(* *) :: output structure
|
|
$+(console-input (console-result out)) :: output function
|
|
:: ::
|
|
++ console-result :: conditional result
|
|
|* out=$+(* *) :: output structure
|
|
$|(@ud (console-product out)) :: error position
|
|
:: ::
|
|
++ console-product :: success result
|
|
|* out=$+(* *) ::
|
|
%+ pair (list tank) ::
|
|
%+ each (unit out) :: ~ is abort
|
|
(pair console-prompt (console-dialog out)) :: ask and continue
|
|
:: ::
|
|
++ console-so :: construct result
|
|
|* pro=* ::
|
|
[p=*(list tank) q=[%& p=[~ u=pro]]] ::
|
|
:: ::
|
|
++ console-yo :: add output tank
|
|
|* [tan=tank res=(console-result)] ::
|
|
?@ res res ::
|
|
[p=[i=tan t=p.res] q=q.res] ::
|
|
:: ::
|
|
++ console-lo :: construct prompt
|
|
|* [pom=console-prompt mor=(console-dialog)] ::
|
|
[p=*(list tank) q=[%| p=pom q=mor]] ::
|
|
:: ::
|
|
++ console-no :: empty result
|
|
[p=*(list tank) q=~] ::
|
|
:: ::
|
|
++ console-go :: parse by rule
|
|
|* [sef=_rule fun=$+(* *)] ::
|
|
|= txt=console-input ::
|
|
=+ vex=(sef [0 0] txt) ::
|
|
?: |(!=((lent txt) q.p.vex) ?=(~ q.vex)) ::
|
|
q.p.vex ::
|
|
(fun p.u.q.vex) ::
|
|
:: ::
|
|
++ console-clock ,[own=@ud his=@ud] :: vector clock
|
|
++ console-edit :: shared state change
|
|
$% [%del p=@ud] :: delete one at
|
|
[%ins p=@ud q=@c] :: insert at
|
|
[%mor p=(list console-edit)] :: combination
|
|
[%nop ~] :: no-op
|
|
[%set p=console-buffer] :: discontinuity
|
|
== ::
|
|
++ console-effect :: app to console
|
|
$% [%bel ~] :: beep
|
|
[%blk p=@ud q=@c] :: blink/match char at
|
|
[%clr ~] :: clear screen
|
|
[%det console-change] :: edit command
|
|
[%err p=@ud] :: error point
|
|
[%mor p=(list console-effect)] :: multiple effects
|
|
[%nex ~] :: save, clear command
|
|
[%pro console-prompt] :: set prompt
|
|
[%sag p=path q=*] :: save to jamfile
|
|
[%sav p=path q=@] :: save to file
|
|
[%tan p=(list tank)] :: classic tank
|
|
:: [%taq p=tanq] :: modern tank
|
|
[%txt p=tape] :: text line
|
|
== ::
|
|
++ console-command :: command state
|
|
$: pos=@ud :: cursor position
|
|
say=console-share :: cursor
|
|
== ::
|
|
++ console-prompt :: prompt definition
|
|
$: vis=? :: command visible
|
|
tag=term :: history mode
|
|
cad=tape :: caption
|
|
== ::
|
|
++ console-input tape :: prompt input
|
|
++ console-share :: symmetric state
|
|
$: ven=console-clock :: our vector clock
|
|
leg=(list console-edit) :: unmerged edits
|
|
buf=console-buffer :: console state
|
|
== ::
|
|
++ dill-belt :: console input
|
|
$% [%aro p=?(%d %l %r %u)] :: arrow key
|
|
[%bac ~] :: true backspace
|
|
[%cru p=@tas q=(list tank)] :: echo error
|
|
[%ctl p=@ud] :: control-key
|
|
[%del ~] :: true delete
|
|
[%met p=@ud] :: meta-key
|
|
[%ret ~] :: return
|
|
[%rez p=@ud q=@ud] :: resize, cols, rows
|
|
[%txt p=(list ,@c)] :: utf32 text
|
|
[%yow p=gill] :: connect to app
|
|
== ::
|
|
++ dill-blit :: console output
|
|
$% [%bel ~] :: make a noise
|
|
[%clr ~] :: clear the screen
|
|
[%hop p=@ud] :: set cursor position
|
|
[%mor p=(list dill-blit)] :: multiple blits
|
|
[%pro p=(list ,@c)] :: show as cursor/line
|
|
[%out p=(list ,@c)] :: send output line
|
|
[%sag p=path q=*] :: save to jamfile
|
|
[%sav p=path q=@] :: save to file
|
|
== ::
|
|
++ gill (pair ship term) :: general contact
|
|
--
|