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
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
John Floren
--
http://nuwen.net/~digi/cluster
Jealousy is all the fun you think they have.
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.
<rant>
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.
</rant>
Russ
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
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.
uriel
On Fri, Nov 04, 2005 at 01:22:35AM +0000, 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.
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.
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
Federico G.Benavento
---
/bin/fortune:
He is more in debt but he weigh.
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
somebody should make a video of typical operations in
rio and acme and put it on sources.
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"
I do this in acme a lot. Type a command, ESC, b2 click.
Russ
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... ;-)
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.
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 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
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
Would be great.
Do you voulenteer ?
Even all simple paths arn't remembered, and it may still fewer
keystrokes.
Don't forget, you can grep the text of the window!
If your prompt is distinctive, you're done.
Still using es on unix (with p9p) and
loving its persistent history
(even though my history file is now 5+ Mb)
Axel.
why not have rio log what you type, or put something between
your keyboard and rio?
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<tree> NOT FOR IN WHILE IF TWIDDLE BANG SUBSHELL SWITCH FN
%type<tree> 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
>
> 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.
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 <Scroll
Lock><Scroll Lock> 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
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
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
> 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.
Is this something like your old pet? :
http://www.deinprogramm.de/scheme-2005/05-knauel/05-knauel.pdf
- kim
Almost yes except that it's using ncurses.
I'd rather use mouse. :)
# wait, linux terminal has supported the mouse?
--
Yep, you've been able to highlight stuff in linux for copy/paste for
at least the last 6 or 7 years that I've been doing it.
I do that on FreeBSD too.
But mainly between virtual terminals... I don't start X unless I'm
really needing multiple visible windows on the screen that I need to
move around at once.
> --
>
>
>