Re: [9fans] tab completion and command history in rc
nope, i didn't object to the reformatting. due to the snow here i was stuck for a couple of hrs with an ancient copy of p9p and decided to have another go at the problem because i wanted history tied to a variable. i came up with this: - erik btw: is there any way to simulate byron's ``(new-ifs-list) {cmd} with rc? for example: fu=x fn fu {echo x} nl = ' ' for(i in ``$nl {whatis fu}) echo $i fu=x fn fn {echo x} ; rcsdiff syn.y === RCS file: RCS/syn.y,v retrieving revision 1.1 diff -r1.1 syn.y 25c25,28 < | line '\n' {return !compile($1);} --- > | line '\n' { int i = !compile($1); > if (!i) > whistory($1); > return i;} ; cat history.c // feel free to roll your eyes. #include "rc.h" #include "exec.h" #include "fns.h" #include "io.h" void whistory(tree* t){ var* v; char* s; int fd; io* o; int flags = OAPPEND|OWRITE; if (!runq->iflag || !t) return; v = vlook("history"); if (!v->val || 1 != count(v->val)) return; if (v->fn) return; // future: fn history {echo $*>>$history_file} s = v->val->word; if((fd=open(s, flags))<0 && (fd=create(s, flags, 0666L))<0){ //setvar("history", 0); return; } o = openfd(fd); pfmt(o, "%t\n", t); closeio(o); } Russ Cox <[EMAIL PROTECTED]> writes | | > i looked at modifying rc to write commands to a history file but it | > didn't seem to fit very well. maybe a hook would be better as in | | it's not hard. perhaps you object to rc's reformatting of | what you typed? | | diff -c ./exec.c h/exec.c | ./exec.c:9,14 - h/exec.c:9,16 | #include "exec.h" | #include "io.h" | #include "fns.h" | + | + tree *line; | /* |* Start executing the given code at the given pc with the given redirection |*/ | ./exec.c:112,118 - h/exec.c:114,120 | { | code bootstrap[32]; | char num[12], *rcmain; | - int i; | + int i, fd; | | /* needed for rcmain later */ | putenv("PLAN9", unsharp("#9")); | ./exec.c:123,128 - h/exec.c:125,132 | if(flag['I']) flag['i'] = 0; | else if(flag['i']==0 && argc==1 && Isatty(0)) flag['i'] = flagset; | rcmain=flag['m']?flag['m'][0]:Rcmain(); | + if((fd = open("/tmp/history", OWRITE)) >= 0) | + history=openfd(fd); | err=openfd(2); | kinit(); | Trapinit(); | ./exec.c:773,778 - h/exec.c:777,788 | } | } | else{ | + if(p->iflag && history && line){ | + char buf[30]; | + strcpy(buf, ctime(time(0))); | + buf[28] = 0; | + pfmt(history, "%s %t\n", buf, line); | + } | ntrap = 0; /* avoid double-interrupts during blocked writes */ | --p->pc;/* re-execute Xrdcmds after codebuf runs */ | start(codebuf, 1, runq->local); | diff -c ./io.h h/io.h | ./io.h:11,16 - h/io.h:11,17 | char *bufp, *ebuf, *strp, buf[NBUF]; | }; | io *err; | + io *history; | io *openfd(int), *openstr(void), *opencore(char *, int); | int emptybuf(io*); | void pchr(io*, int); | diff -c ./rc.h h/rc.h | ./rc.h:143,145 - h/rc.h:143,146 | int lastc; | int lastword; | int kidpid; | + extern tree *line; | diff -c ./syn.y h/syn.y | ./syn.y:21,28 - h/syn.y:21,28 | %type NOT FOR IN WHILE IF TWIDDLE BANG SUBSHELL SWITCH FN | %type WORD REDIR DUP PIPE | %% | - rc: { return 1;} | - | line '\n' {return !compile($1);} | + rc: { line = nil; return 1;} | + | line '\n' { line = $1; return !compile($1);} | line: cmd | | cmdsa line {$$=tree2(';', $1, $2);} | body: cmd sendmail 9fans@cse.psu.edu From: erik quanstrom <[EMAIL PROTECTED]> Reply-To: erik quanstrom <[EMAIL PROTECTED]> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>, Russ Cox <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: <[EMAIL PROTECTED]> Subject: Re: [9fans] tab compl
Re: [9fans] tab completion and command history in rc
Scott Schwartz wrote: | global /persisitant/ history is a "must have" for me. I have to agree--it's a great feature. But one might argue that you want global persistant tty input even more, so it's rio that ought to be recording what you've typed. on the amiga, in the later days, it was in the windowing system as well. I don't recall how it all worked, but all console apps got history IIRC. ron
Re: [9fans] tab completion and command history in rc
script(1) already does what you suggest on linux for 1 termanal. but it's definately not what i want. what utility would the saved text be? i think rio's editing features would make it very hard to decipher. - erik Scott Schwartz <[EMAIL PROTECTED]> writes | | | global /persisitant/ history is a "must have" for me. | | I have to agree--it's a great feature. But one might argue that you | want global persistant tty input even more, so it's rio that ought to | be recording what you've typed.
Re: [9fans] tab completion and command history in rc
> i thought about that. it really seems like the "right" solution in > once sense. it moves history completely out of the purview of > the shell. the bonus is that you would have history for every application. > > the downside is that you would have history for every application. that's > explicitly not what i want. the input to ed/sam -d editing sessions > interleaved > with mail and rc commands doesn't seem very useful to me. i was thinking of something along the lines of reactive keyboard, or better; something that adapts to your context. if u cn rd ths u shd gt a btr fon
Re: [9fans] tab completion and command history in rc
| global /persisitant/ history is a "must have" for me. I have to agree--it's a great feature. But one might argue that you want global persistant tty input even more, so it's rio that ought to be recording what you've typed.
Re: [9fans] tab completion and command history in rc
> So, Rian, if there's stuff you find you miss on Plan 9, it may be you > have not learned a "Plan 9" way to do things, or it may be that Plan 9 > environment is lacking in some way. I think many of us take a guilty > pleasure in ^F. I know I do. What else might we like from the unix world > that we don't talk about? It would be interesting to see. A list on the wiki would not go amiss. No harm in a bit of objectivity and soul searching. In passing, it's great news that VESA and a new VM are about to happen, shows that in important places Plan 9 is still significant enough to assign valuable resources to. But, as Ron points out, Plan 9 has its own "True Way (TM)" that occasionally puts a huge spanner in the works. One of my gripes is the PC keyboard. I haven't a clue what contorsions the kernel goes through to provide the final product, but the end result is not what I would ask for. For example, the tap is used to switch the "console" on a two-way switch I'm using: that generates two Peter faces in Plan 9. Wrong? Maybe not, but it's too different to be declared exemplary. And for all that using the mouse is demonstrated to be faster, as long as mouse _and_ keyboard are both in use, I think pulling one's hands off the keyboard to re-position the cursor is a silly necessity (as demonstrated by the introduction of cursor-right and cursor-left keys). Now let me go look at hiding that fat arrow out of the way while I type with both hands. ++L
Re: [9fans] tab completion and command history in rc
John Floren wrote: Ouch. You seem to have unconsciously hit on some of the more hot-button topics for Plan 9 users. Tab completion is partly implemented; hit "Ctrl-f". However, as a quick foray onto #plan9 will tell you, nobody seems to believe in tab completion, finding multiple "ls" commands and copy-pasting to be faster. As for command history, you are expected to find the previous command in your rc window, edit it, copy it, paste it to the prompt, and then run it. This is obviously more efficient than hitting the "up" arrow. Well, if you're just going to execute the same command again, 'up' can be great. More often than not you're going to edit the command slightly, in which case just point and click/mark with the mouse to edit and about 3 mouse clicks to run it can be faster than it sounds - and in many cases faster than various keyboard gymnastics to get to the same point you're going to edit. This is my experience atleast. If you have to poke around pages of output to find the last command, this isn't that great though. So both approaches has their strengths and flaws. Merge them.
Re: [9fans] tab completion and command history in rc
> i looked at modifying rc to write commands to a history file but it > didn't seem to fit very well. maybe a hook would be better as in it's not hard. perhaps you object to rc's reformatting of what you typed? diff -c ./exec.c h/exec.c ./exec.c:9,14 - h/exec.c:9,16 #include "exec.h" #include "io.h" #include "fns.h" + + tree *line; /* * Start executing the given code at the given pc with the given redirection */ ./exec.c:112,118 - h/exec.c:114,120 { code bootstrap[32]; char num[12], *rcmain; - int i; + int i, fd; /* needed for rcmain later */ putenv("PLAN9", unsharp("#9")); ./exec.c:123,128 - h/exec.c:125,132 if(flag['I']) flag['i'] = 0; else if(flag['i']==0 && argc==1 && Isatty(0)) flag['i'] = flagset; rcmain=flag['m']?flag['m'][0]:Rcmain(); + if((fd = open("/tmp/history", OWRITE)) >= 0) + history=openfd(fd); err=openfd(2); kinit(); Trapinit(); ./exec.c:773,778 - h/exec.c:777,788 } } else{ + if(p->iflag && history && line){ + char buf[30]; + strcpy(buf, ctime(time(0))); + buf[28] = 0; + pfmt(history, "%s %t\n", buf, line); + } ntrap = 0; /* avoid double-interrupts during blocked writes */ --p->pc;/* re-execute Xrdcmds after codebuf runs */ start(codebuf, 1, runq->local); diff -c ./io.h h/io.h ./io.h:11,16 - h/io.h:11,17 char *bufp, *ebuf, *strp, buf[NBUF]; }; io *err; + io *history; io *openfd(int), *openstr(void), *opencore(char *, int); int emptybuf(io*); void pchr(io*, int); diff -c ./rc.h h/rc.h ./rc.h:143,145 - h/rc.h:143,146 int lastc; int lastword; int kidpid; + extern tree *line; diff -c ./syn.y h/syn.y ./syn.y:21,28 - h/syn.y:21,28 %type NOT FOR IN WHILE IF TWIDDLE BANG SUBSHELL SWITCH FN %type WORD REDIR DUP PIPE %% - rc: { return 1;} - | line '\n' {return !compile($1);} + rc: { line = nil; return 1;} + | line '\n' { line = $1; return !compile($1);} line: cmd | cmdsa line {$$=tree2(';', $1, $2);} body: cmd
Re: [9fans] tab completion and command history in rc
i thought about that. it really seems like the "right" solution in once sense. it moves history completely out of the purview of the shell. the bonus is that you would have history for every application. the downside is that you would have history for every application. that's explicitly not what i want. the input to ed/sam -d editing sessions interleaved with mail and rc commands doesn't seem very useful to me. rio thus "feels" to me like the wrong level at which to implement this functionality. to summarize: a. rio doesn't know if the input is an rc command or input to, say, sam -d. b. it would be nice to improve on the old history mechanism; rio doesn't have enough information to do this. e.g. 1. syntax errors shouldn't be logged to the history 2. multiline statements should be recalled as a unit. for me (a) would be a big problem. (b) hasn't been solved in a decade, so i guess i can live with it. ;-) - erik Charles Forsyth <[EMAIL PROTECTED]> writes | | > i looked at modifying rc to write commands to a history file but it | > didn't seem to fit very well. maybe a hook would be better as in | | why not have rio log what you type, or put something between | your keyboard and rio?
Re: [9fans] tab completion and command history in rc
yup. byron's rc will do the same thing. i've lost my history file a few times but i still have ~10M of it. history still performs well enough not to notice. erik Axel Belinfante <[EMAIL PROTECTED]> writes | | > paul haahr's shell es went all the way and | > made the whole interactive loop a function. | | Still using es on unix (with p9p) and | loving its persistent history | (even though my history file is now 5+ Mb) | | Axel.
Re: [9fans] tab completion and command history in rc
> i looked at modifying rc to write commands to a history file but it > didn't seem to fit very well. maybe a hook would be better as in why not have rio log what you type, or put something between your keyboard and rio?
Re: [9fans] tab completion and command history in rc
> paul haahr's shell es went all the way and > made the whole interactive loop a function. Still using es on unix (with p9p) and loving its persistent history (even though my history file is now 5+ Mb) Axel.
Re: [9fans] tab completion and command history in rc
Ronald G Minnich writes | [...] On Plan 9, I still miss command | history that spans instances of the shell. Sorry, that's not "Plan 9 | PC", but it's my preference. global /persisitant/ history is a "must have" for me. it was the reason i utf-8ized byron's (unmaintained?) shell. productivity will suffer just a little bit if you have to retype something as a last resort. but trying to figure out that ip address you ssh'd to last week/month/year could waste 10 minutes. grepping persistant history is a big win for me. (if you want global but non-persistant history on p9p changing the " command to look at all your open windows wouldn't be too hard but you would have an ordering problem; it would difficult to order the commands correctly.) i looked at modifying rc to write commands to a history file but it didn't seem to fit very well. maybe a hook would be better as in fn post-cmd { echo $* >> $history } paul haahr's shell es went all the way and made the whole interactive loop a function. erik
Re: [9fans] tab completion and command history in rc
I agree this would be very helpful not only for instructional purposes but to show off some of the features of plan9. Add captions and narration and it is very handy. On 11/4/05, Skip Tavakkolian <[EMAIL PROTECTED]> wrote: > Edit any line in your window, double click at the start or end of the> line to select it, and then Middle-click->Send; is a very common and > useful idiom(note that in the default profile your shell prompt is> defined as a NOP function precisely for this).somebody should make a video of typical operations inrio and acme and put it on sources.
Re: [9fans] tab completion and command history in rc
| As for command history, you are expected to | find the previous command in your rc window, edit it, copy it, paste it | to the prompt, and then run it. This is obviously more efficient than | hitting the "up" arrow. Don't forget, you can grep the text of the window! If your prompt is distinctive, you're done.
Re: [9fans] tab completion and command history in rc
On Fri, 2005-11-04 at 02:45 +0100, Uriel wrote: > One last note: one of the reasons why tab-completion is frowned upon is > because it's indication of too intricate paths, remember to keep your > file trees clean and simple and to take advantage of binds and union > mounts to keep everything at hand. If you do this you won't miss > tab-completion and you will have a much easier time finding what you are > looking for. Even all simple paths arn't remembered, and it may still fewer keystrokes.
Re: [9fans] tab completion and command history in rc
On Fri, 2005-11-04 at 03:16 +0100, Skip Tavakkolian wrote: > > Edit any line in your window, double click at the start or end of the > > line to select it, and then Middle-click->Send; is a very common and > > useful idiom(note that in the default profile your shell prompt is > > defined as a NOP function precisely for this). > > somebody should make a video of typical operations in > rio and acme and put it on sources. Would be great. Do you voulenteer ?
Re: [9fans] tab completion and command history in rc
On 11/3/05, Ronald G Minnich wrote: > I don't think that rc and the rio interface and all that are the be-all > and end-all of interfaces. Neither are X11, Emacs, and bash. It's all a > work in progress, all the time. There are features from each I miss on > the other. I've been using a Mac for about six months now, and found that I've accidentally become an Exposé addict. Just today I was at work with way too many windows open, trying to work on one project while my boss was instant messaging me about some other project, and I flung my cursor into the upper-right corner, waited three seconds and started muttering, "What the HELL?!?" before I realized that Windows was not going to comply with my gesture. Keeping mouse buttons straight between X, PuTTY, rio, acme, CMD, etc., context sensitivities among command/control key options in Aqua, GNOME and Windows, and command-line parameters between Plan 9, GNU and MS is enough to drive a person crazy. I may have chortled a bit too gleefully at Takeshi's button-3 mishap, laughing not just at him but with him. I think I have the most respect for Russ, apparently navigating X, Qt/GTK+, acme and rio apps simultaneously on a regular basis. But perhaps he's still young enough that the hair grows back. :) -Jack
Re: [9fans] tab completion and command history in rc
> On Linux, I find myself trying to mouse into the middle of a window and > type text; and of course there's all the other Plan 9 bits you don't get > on Unix that you miss a lot. I pound the keyboard a lot. I go through a > lot of keyboards. One advantage of buying clusters is you have lots of > keyboards lying around. He's not lying. I'm right next door and occasionally feel rather sorry for the poor devices... ;) -m --- Matthew Sottile ([EMAIL PROTECTED]) Advanced Computing Laboratory (CCS-1) Los Alamos National Laboratory Los Alamos, NM 87545 Phone: (505)665-6057
Re: [9fans] tab completion and command history in rc
I don't think that rc and the rio interface and all that are the be-all and end-all of interfaces. Neither are X11, Emacs, and bash. It's all a work in progress, all the time. There are features from each I miss on the other. On Linux, I find myself trying to mouse into the middle of a window and type text; and of course there's all the other Plan 9 bits you don't get on Unix that you miss a lot. I pound the keyboard a lot. I go through a lot of keyboards. One advantage of buying clusters is you have lots of keyboards lying around. I get really annoyed that up and down arrow act very differently than right and left arrow in acme. I get annoyed that acme is focus follows mouse, and rio is not (well, andrey built me a rio with focus follows mouse for linux, and I love it). On Plan 9, I still miss command history that spans instances of the shell. Sorry, that's not "Plan 9 PC", but it's my preference. So, Rian, if there's stuff you find you miss on Plan 9, it may be you have not learned a "Plan 9" way to do things, or it may be that Plan 9 environment is lacking in some way. I think many of us take a guilty pleasure in ^F. I know I do. What else might we like from the unix world that we don't talk about? It would be interesting to see. ron
Re: [9fans] tab completion and command history in rc
> While I was looking into win src to see how easy it is > to let it learn to output to +Errors window It turned out to be easy to do a first rough attempt. You can download main.c into /acme/bin/source/win, mk and run as "/somewhere/win -m". http://p9c.cc.titech.ac.jp/plan9/tmp/main.c -- "on travel, off the network ... and a fossil in my pocket"
Re: [9fans] tab completion and command history in rc
Well, I strongly dis-recommend button-3'ing /dev/cons in acme. ;) While I was looking into win src to see how easy it is to let it learn to output to +Errors window, I mistakenly clicked the path-which-not-to-be-mentioned. -- "on travel, off the network ... and a fossil in my pocket"
Re: [9fans] tab completion and command history in rc
> Yes. This method is almost there except that > if you resize or move a directory window, > the command "history" is gone. :) Don't type in directory windows then... ;-)
Re: [9fans] tab completion and command history in rc
> I do this in acme a lot. Type a command, ESC, b2 click. Yes. This method is almost there except that if you resize or move a directory window, the command "history" is gone. :) -- "on travel, off the network ... and a fossil in my pocket"
Re: [9fans] tab completion and command history in rc
On 11/3/05, YAMANASHI Takeshi <[EMAIL PROTECTED]> wrote: > > As for command history, you are expected to > > find the previous command in your rc window, edit it, copy it, paste it > > to the prompt, and then run it. This is obviously more efficient than > > hitting the "up" arrow. > > As for keeping the command line always in view, mid-click on the window > > and select "scroll". > > This reminded me of my old pet idea. To ease finding the desired command > in a window, how's it to split the window into two panes like sam does? > I mean, you always enter commands in the command pane and every outputs will > appear in the other output pane. > > In acme, you could achieve similar effect by typing commands in a directory > window and the output appears in another "+Errors" window, but it's tiresome > to Button-2'ing the command everytime. I do this in acme a lot. Type a command, ESC, b2 click. Russ
Re: [9fans] tab completion and command history in rc
> As for command history, you are expected to > find the previous command in your rc window, edit it, copy it, paste it > to the prompt, and then run it. This is obviously more efficient than > hitting the "up" arrow. > As for keeping the command line always in view, mid-click on the window > and select "scroll". This reminded me of my old pet idea. To ease finding the desired command in a window, how's it to split the window into two panes like sam does? I mean, you always enter commands in the command pane and every outputs will appear in the other output pane. In acme, you could achieve similar effect by typing commands in a directory window and the output appears in another "+Errors" window, but it's tiresome to Button-2'ing the command everytime. -- "on travel, off the network ... and a fossil in my pocket"
Re: [9fans] tab completion and command history in rc
> Edit any line in your window, double click at the start or end of the > line to select it, and then Middle-click->Send; is a very common and > useful idiom(note that in the default profile your shell prompt is > defined as a NOP function precisely for this). somebody should make a video of typical operations in rio and acme and put it on sources.
Re: [9fans] tab completion and command history in rc
> One last note: one of the reasons why tab-completion is frowned upon is > because it's indication of too intricate paths, remember to keep your > file trees clean and simple and to take advantage of binds and union > mounts to keep everything at hand. If you do this you won't miss > tab-completion and you will have a much easier time finding what you are > looking for. I don't buy this. You can have a very simple path and still not remember what a command is called. I typed venti/^F the other day and was annoyed that I didn't get a list of the venti programs. So I typed ^U/bin/venti/^F and did get my list. But there's a difference between clean and easy to remember. Russ
Re: [9fans] tab completion and command history in rc
see: http://www.cs.bell-labs.com/wiki/plan9/Mouse_vs._keyboard Federico G.Benavento --- /bin/fortune: He is more in debt but he weigh.
Re: [9fans] tab completion and command history in rc
Disclaimer: Please don't take me the wrong way, I spent a large portion of today reading the Plan 9 papers and the descriptions behind sam and rc, as well as various man pages. I guess I didn't think to look in the window(1) man page for the answers to my question was because i thought this would be implemented in rc than in rio (basically because that's how its done in unix). I credit this blunder to still having a very unixish perception of Plan 9. I knew about mouse-chording/send from reading doc on Acme, but I didn't realize it was also used in rio. Once I become more familiar with this interface I can see myself liking it a lot. As for now I'm still grumpy when I have to remove my hands from the home position on the keyboard, but i know that new ideas and innovation require change and challenge to old de factos and standards. Thanks for your patience and immediate replies! Rian Hunter On Nov 3, 2005, at 8:22 PM, Uriel wrote: On Thu, Nov 03, 2005 at 08:14:29PM -0500, John Floren wrote: As for command history, you are expected to find the previous command in your rc window, edit it, copy it, paste it to the prompt, and then run it. This is obviously more efficient than hitting the "up" arrow. No need to copy/paste(and if you do, do it mouse-chording), you can use "Send" directly. Edit any line in your window, double click at the start or end of the line to select it, and then Middle-click->Send; is a very common and useful idiom(note that in the default profile your shell prompt is defined as a NOP function precisely for this). This are all FAQs, I think for the most part are well documented in the papers, man pages and the Wiki; and of course lots of material and in the 9fans archives. The Plan 9 community can be friendly or harsh, but reading the docs is always well worth the time. uriel
Re: [9fans] tab completion and command history in rc
>They complain that ^F doesn't work if rio's name space is different from the >window in which ^F is typed. you can use the "local" script in the tip o the day page, to change the the plumbing namespace. btw, I use ^F all the time, because I'm too lazy. Federico G.Benavento --- /bin/fortune: He lost both Ali-pilaf and Vali-pilaf.
Re: [9fans] tab completion and command history in rc
One last note: one of the reasons why tab-completion is frowned upon is because it's indication of too intricate paths, remember to keep your file trees clean and simple and to take advantage of binds and union mounts to keep everything at hand. If you do this you won't miss tab-completion and you will have a much easier time finding what you are looking for. uriel On Fri, Nov 04, 2005 at 01:22:35AM +, Uriel wrote: > On Thu, Nov 03, 2005 at 08:14:29PM -0500, John Floren wrote: > > As for command history, you are expected to > > find the previous command in your rc window, edit it, copy it, paste it > > to the prompt, and then run it. This is obviously more efficient than > > hitting the "up" arrow. > No need to copy/paste(and if you do, do it mouse-chording), you can use > "Send" directly. > > Edit any line in your window, double click at the start or end of the > line to select it, and then Middle-click->Send; is a very common and > useful idiom(note that in the default profile your shell prompt is > defined as a NOP function precisely for this). > > This are all FAQs, I think for the most part are well documented in the > papers, man pages and the Wiki; and of course lots of material and in > the 9fans archives. > > The Plan 9 community can be friendly or harsh, but reading the docs is > always well worth the time. > > uriel
Re: [9fans] tab completion and command history in rc
On 3-Nov-05, at 5:14 PM, John Floren wrote: As for command history, you are expected tofind the previous command in your rc window, edit it, copy it, paste itto the prompt, and then run it. This is obviously more efficient thanhitting the "up" arrow.Methinks you overstate the case...The " and "" commands work beautifully - " searches the text in the window and spits out the lines of text that match a prompt followed by the given argument, you can then sweep the one you want and click-send it; "" runs the last match. Things I prefer about this is that if you keep your path in the prompt, then you even get the directory context at hand for where the command was executed. Handy. That said, I don't do a lot of heavy work in a 9term - mostly I work in a win window in acme where the combination of 2-1 chording and button 3 searching is substantially more effective than 9term's somewhat awkward send mechanism.Paul
Re: [9fans] tab completion and command history in rc
On Thu, Nov 03, 2005 at 08:14:29PM -0500, John Floren wrote: > As for command history, you are expected to > find the previous command in your rc window, edit it, copy it, paste it > to the prompt, and then run it. This is obviously more efficient than > hitting the "up" arrow. No need to copy/paste(and if you do, do it mouse-chording), you can use "Send" directly. Edit any line in your window, double click at the start or end of the line to select it, and then Middle-click->Send; is a very common and useful idiom(note that in the default profile your shell prompt is defined as a NOP function precisely for this). This are all FAQs, I think for the most part are well documented in the papers, man pages and the Wiki; and of course lots of material and in the 9fans archives. The Plan 9 community can be friendly or harsh, but reading the docs is always well worth the time. uriel
Re: [9fans] tab completion and command history in rc
> copy-pasting to be faster. As for command history, you are expected to > find the previous command in your rc window, edit it, copy it, paste it > to the prompt, and then run it. This is obviously more efficient than > hitting the "up" arrow. See /n/sources/contrib/rsc/scripts/" and /n/sources/contrib/rsc/scripts/"" for scripts that let you more easily find things in the rc window. As for ^F, I use it all the time and am very happy with it. The #plan9 crowd is a bit too much into the religious fanaticism. They complain that ^F doesn't work if rio's name space is different from the window in which ^F is typed. That's true, but it's also true of the plumber and yet the plumber is sacrosanct. There's a lot in Plan 9 that works only because of conventions. It's very powerful when used properly. For example, it's great that I can @{rfork n; import other-machine /proc; ps} but not so great that I can @{rfork n; bind /env /proc; ps} Is that an argument that ps or bind or /proc is a bad idea? No. It's an argument that you have to follow the conventions or things get confused. Russ
Re: [9fans] tab completion and command history in rc
Rian Hunter wrote: > Hi, > > I'm very very new to Plan 9 and I'm very conscious of the fact that > things are done differently if not better than in the unix family. In > bash and in some versions of csh and sh there is tab-completion and > command history (you get these effects by pressing tab or up, > respectively, on the keyboard). Does that exist in rc, or is it done in > different way in Plan 9? > > Also on my keyboard my directional buttons no longer work, so in a > terminal window running in rio it's very frustrating when I get to the > bottom of the window and have to use the mouse to scroll down or press > enter twice. Is there a way so that the command line always stays in > sight in the terminal window? or, are there other key sequences I can > use to simulate up down left and right (similar to hjkl in vi or ctrl+n > or ctrl+p in emacs/bash). > > Thanks! > > Rian Hunter > Ouch. You seem to have unconsciously hit on some of the more hot-button topics for Plan 9 users. Tab completion is partly implemented; hit "Ctrl-f". However, as a quick foray onto #plan9 will tell you, nobody seems to believe in tab completion, finding multiple "ls" commands and copy-pasting to be faster. As for command history, you are expected to find the previous command in your rc window, edit it, copy it, paste it to the prompt, and then run it. This is obviously more efficient than hitting the "up" arrow. As for keeping the command line always in view, mid-click on the window and select "scroll". I really can't help you with regard to your directional buttons. John Floren -- http://nuwen.net/~digi/cluster Jealousy is all the fun you think they have.
Re: [9fans] tab completion and command history in rc
> I'm very very new to Plan 9 and I'm very conscious of the fact that > things are done differently if not better than in the unix family. In > bash and in some versions of csh and sh there is tab-completion and > command history (you get these effects by pressing tab or up, > respectively, on the keyboard). Does that exist in rc, or is it done > in different way in Plan 9? You can use ^F to get file name (not command) completion. Command resending is done using the mouse (you can also edit the command before resending it). > Also on my keyboard my directional buttons no longer work, so in a > terminal window running in rio it's very frustrating when I get to > the bottom of the window and have to use the mouse to scroll down or > press enter twice. Is there a way so that the command line always > stays in sight in the terminal window? Select "scroll" from the button-2 menu. > or, are there other key > sequences I can use to simulate up down left and right (similar to > hjkl in vi or ctrl+n or ctrl+p in emacs/bash). Page down or down arrow will scroll the window down too. Your down arrow key probably doesn't work because you are using an old drawterm. Try running one of the binaries at http://swtch.com/drawterm/ which are newer and have the new key code for down arrow. Russ
Re: [9fans] tab completion and command history in rc
See window(1) On Thu, Nov 03, 2005 at 07:59:26PM -0500, Rian Hunter wrote: > Hi, > > I'm very very new to Plan 9 and I'm very conscious of the fact that > things are done differently if not better than in the unix family. In > bash and in some versions of csh and sh there is tab-completion and > command history (you get these effects by pressing tab or up, > respectively, on the keyboard). Does that exist in rc, or is it done > in different way in Plan 9? > > Also on my keyboard my directional buttons no longer work, so in a > terminal window running in rio it's very frustrating when I get to > the bottom of the window and have to use the mouse to scroll down or > press enter twice. Is there a way so that the command line always > stays in sight in the terminal window? or, are there other key > sequences I can use to simulate up down left and right (similar to > hjkl in vi or ctrl+n or ctrl+p in emacs/bash). > > Thanks! > > Rian Hunter
[9fans] tab completion and command history in rc
Hi, I'm very very new to Plan 9 and I'm very conscious of the fact that things are done differently if not better than in the unix family. In bash and in some versions of csh and sh there is tab-completion and command history (you get these effects by pressing tab or up, respectively, on the keyboard). Does that exist in rc, or is it done in different way in Plan 9? Also on my keyboard my directional buttons no longer work, so in a terminal window running in rio it's very frustrating when I get to the bottom of the window and have to use the mouse to scroll down or press enter twice. Is there a way so that the command line always stays in sight in the terminal window? or, are there other key sequences I can use to simulate up down left and right (similar to hjkl in vi or ctrl+n or ctrl+p in emacs/bash). Thanks! Rian Hunter