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

View File

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