Merge branch 'shell' of https://github.com/urbit/urbit into shell

Conflicts:
	urb/zod/main/app/terminal/core.hook
This commit is contained in:
Ubuntu 2014-10-07 23:06:44 +00:00
commit 1dc3b34108
2 changed files with 41 additions and 25 deletions

View File

@ -10,14 +10,17 @@
::
|% ::
++ gift ::
$% [%rush p=%txt q=cord] ::
[%rush p=%term-line q=term-line] ::
$% [%rush p=gilt] ::
[%mean p=ares] ::
[%nice ~] ::
[%meta p=vase] ::
[%veer p=@ta q=path r=@t] ::
[%vega p=path] ::
== ::
++ gilt ::
$% [%term-line p=term-line] ::
[%txt p=cord] ::
== ::
++ hapt ,[p=ship q=path] ::
++ move ,[p=bone q=(mold note gift)] ::
++ note ::
@ -115,7 +118,8 @@
(print ost you ~)
%out :: to terminal
?> ?=(~ t.pax)
`+>.$
:_ +>.$
[ost %give %rush %term-line `term-line`[prompt ~ ~]]~
==
::
++ cubs
@ -242,6 +246,7 @@
++ purr
|= [ost=bone pax=path typ=type sih=sign]
^- [(list move) _+>]
::~& shel-purr/pax
:: ~& [%shell-pour -.sih (,@ta +<.sih)]
::=+ sih=((hard sign) sih)
?: ?=(%veer +<.sih) :: vomit
@ -263,7 +268,9 @@
?+ &3.pax ~& %strange-child-path !!
%main
?> ?=(?(%nice %mean) +<.sih)
[ost %give +.sih]~
:- [ost %give +.sih]
::~& act
(print ost our.hid ~)
%out
?. ?=(?(%rust %rush) +<.sih) ~
?: (~(has by pip) &2.pax)
@ -282,16 +289,18 @@
++ stash
|= [a=bone b=ship c=cord]
%^ spam /out %meta
!>(`gift`[%rush %term-line [prompt [c]~ ~]])
!>([%rush %term-line `term-line`[prompt [c]~ ~]])
::
++ print |=([a=bone b=ship c=(list tank)] (print-vase a b !>(c)))
++ print-vase
|= [ost=bone you=ship tan=vase] :: [p=p:!>(*(list tank)) q=*]
^- (list move)
::~& shel-print/prompt
%^ spam /out %meta
:(slop !>(%rush) !>(%term-line) !>(prompt) !>(~) tan)
::
++ prompt
^- @t
?^ act
(rap 3 (~(got by cub.hid) u.act) '(' u.act ') ' ~)
?. =('0' &3.pax)

View File

@ -68,6 +68,8 @@
;script(src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
;script: urb.appl = "{(trip app.hid)}"
;script: urb.term = \{pax: "{(spud pax)}"}
;script(src "//use.typekit.net/fkv0sjk.js");
;script:'try{Typekit.load();}catch(e){}'
;script:'''
jpok = function(a,b){
var dat = {pax:urb.term.pax, act:{}}
@ -84,8 +86,9 @@
}
body,
span,
pre,
input {
font-family: monospace;
font-family: 'source-code-pro', monospace;
font-size: 1rem;
background-color: #000;
color: #fff;
@ -117,26 +120,30 @@
var hist = [], hind = 0;
$(prom).keydown(function(e){
switch(e.which){
default: return true
break; case 13: // %retn
prem.textContent += prom.value
jpok('line', prom.value)
hist.unshift(prom.value)
$(this).val('')
break; case 38: // %up
if(hind == hist.length) return true;
prom.value = [hist[hind], hist[hind] = prom.value][0]
hind++
return false
break; case 40: // %down
if(hind == 0) return true
hind--
prom.value = [hist[hind], hist[hind] = prom.value][0]
return false
default: return true
break;
case 13: // %retn
prem.textContent += prom.value
jpok('line', prom.value)
hist.unshift(prom.value)
$(this).val('')
break;
case 38: // %up
if(hind == hist.length) return true;
prom.value = [hist[hind], hist[hind] = prom.value][0]
hind++
return false
break;
case 40: // %down
if(hind == 0) return true
hind--
prom.value = [hist[hind], hist[hind] = prom.value][0]
return false
}
})
$(prom).focus()
$(prem).on('click', function() { $(prom).focus(); })
var focus = function() { $(prom).focus(); }
$('body').on('click', focus)
focus()
var pax = '/lines'
if(urb.term.pax != "/") pax += urb.term.pax
urb.subscribe({path: pax}, function(e, dat){
@ -196,7 +203,7 @@
:_ +>.$
%+ welp mof
:^ [ost %give %nice ~]
:^ ost %pass hi/in/pax
:^ ost %pass hi/in/[pax]
:^ %g %show [our.hid (encode p.jof pax) imp.hid]
:- you /out
[ost %pass hi/mar/pax %g %sire [p.jof (encode p.jof pax)]]