diff options
author | ftrvxmtrx <ftrvxmtrx@gmail.com> | 2014-12-21 01:28:14 +0100 |
---|---|---|
committer | ftrvxmtrx <ftrvxmtrx@gmail.com> | 2014-12-21 01:28:14 +0100 |
commit | 758496ecaa42b5f6c17c0bd1e0f43189e50e0745 (patch) | |
tree | 160edba01a6f720d146b811c134a137d855a9846 /sys/src/cmd/sam/cmd.c | |
parent | 476a47b15c152e72aa8a6d9f9eb363931cbfd50f (diff) |
sam: '^' and '_' cmds; same as '<' and '|' except that stdout goes to the command window
Diffstat (limited to 'sys/src/cmd/sam/cmd.c')
-rw-r--r-- | sys/src/cmd/sam/cmd.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/src/cmd/sam/cmd.c b/sys/src/cmd/sam/cmd.c index a0e336f01..6e8efa094 100644 --- a/sys/src/cmd/sam/cmd.c +++ b/sys/src/cmd/sam/cmd.c @@ -35,6 +35,8 @@ Cmdtab cmdtab[]={ '>', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, '<', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, '|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, + '^', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, + '_', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, '=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd, 'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd, 0, 0, 0, 0, 0, 0, 0, 0, @@ -76,7 +78,13 @@ inputc(void) Again: nbuf = 0; - if(downloaded){ + if(cmdbufpos > cmdbuf.nc && cmdbuf.nc > 0){ + cmdbufpos = 0; + bufreset(&cmdbuf); + } + if(cmdbufpos < cmdbuf.nc && cmdbuf.nc > 0) + bufread(&cmdbuf, cmdbufpos++, &r, 1); + else if(downloaded){ while(termoutp == terminp){ cmdupdate(); if(patset) |