diff --git a/modules/applications/nshc.lua b/modules/applications/nshc.lua index 375c549..ef8be1f 100644 --- a/modules/applications/nshc.lua +++ b/modules/applications/nshc.lua @@ -1,5 +1,4 @@ function nshc_w(evPP,nid) - write("\f") while true do if ev[1] == "net_msg" then local V,msg=false,tostring(ev[4]) @@ -8,22 +7,23 @@ function nshc_w(evPP,nid) write(msg:sub(4)) end end - elseif ev[1] == "key" and ev[2] == tT[cT][3].sI then + elseif ev[1] == "key" and ev[2] == E().sI and ev[3] == 29 and ev[4] == 27 then + break + elseif ev[1] == "key" and ev[2] == E().sI then ns(nid,evPP,"key"..tostring(ev[3])) end C.yield() end + ns(nid,evPP,"exit") end function nshc(P,nid) ns(nid,P,"initnsh") while true do - if ev[1] == "net_msg" then - print(T.unpack(ev)) - end if ev[1] == "net_msg" and ev[2] == nid and ev[3] == P then - nshc_w(ev[4],nid) + break end C.yield() end + nshc_w(ev[4],nid) end diff --git a/modules/applications/nshd.lua b/modules/applications/nshd.lua index acb452e..f6a13ae 100644 --- a/modules/applications/nshd.lua +++ b/modules/applications/nshd.lua @@ -6,6 +6,7 @@ s("netsh daemon - "..tostring(sI),function() print(pcall(function() if ev[3] == evPP and ev[2] == cA then if msg:sub(1,3) == "key" then h("key",tT[cT][3].sI,tonumber(msg:sub(4)),0) + elseif msg == "exit" then break end end elseif ev[1] == "display" and ev[3] == tT[cT][3].sI then