9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] command history
@ 2000-07-14 21:37 Russ Cox
  2000-07-14 23:24 ` Richard
  0 siblings, 1 reply; 6+ messages in thread
From: Russ Cox @ 2000-07-14 21:37 UTC (permalink / raw)
  To: 9fans

	it also has a bunch of affordances --delete_word and such-- for editing
	a command line --a task that in the Plan 9 style is done with a mouse
	and Rio.

^w will delete the current word,
in the editors and in rio.  and ^u
the current line.  be careful though:
^w deletes the current _window_
in microsoft-land, which is bad news
once your fingers get trained.

some people said they didn't get this
yesterday, so since i'm talking...

g% cat /usr/rsc/bin/rc/"
#!/bin/rc

{
	if(test -r /mnt/acme/acme/body)
		cat /mnt/acme/acme/body
	if not
		cat /dev/text
} | grep '^[^ 	]*%[ 	]*'$1  |
	{echo; cat} | pr -t -n | sort -u +1 | sort -n |
	sed 's/^ *[0-9]+	//' | grep .

# the silly {echo; cat} gets around pr printing "empty file" when
# presented with no input.
g%

for example:

g% " mk
>>> g% mk
>>> g% mk test
g%

shows the commands i've run in this window
that begin with "mk", ripe for editing or resending.

(except the >>>'s don't get printed in real life).



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [9fans] command history
@ 2000-07-14 19:44 Russ Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Russ Cox @ 2000-07-14 19:44 UTC (permalink / raw)
  To: 9fans, sharris

It really is called ".  

I posted it yesterday.  If you wait a couple
hours it will probably come by again, now
that the echo is back.
I'll send you a copy separately though.

The " is, I believe, a reference to the common
shorthand meaning ``same as line above''.

Russ



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [9fans] command history
@ 2000-07-14 14:16 Stephen C. Harris
  2000-07-14 21:03 ` Richard Uhtenwoldt
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen C. Harris @ 2000-07-14 14:16 UTC (permalink / raw)
  To: 9fans

Anthony Sorace <anothy@eden.rutgers.edu> wrote:
> //is it possible to use history and command completion with rc?
>  
> no. rc has neither of these functions. history is the job of the 
> windowing system - simply snarf your previous commands, edit in 
> place, send them down... it's much better than the history built 
> into most shells

Except if there's a lot of output, or you want to go back more than one
command, it's sometimes hard to find your previous command in the first 
place.

As for snarfing commands before sending, that doesn't work if you 
want to go back several commands.  And I usually don't know I need to 
redo a command until I see something weird later in its output or 
elsewhere.

What about having a keystroke or something which just scrolls rc's window
back and positions the cursor exactly on the previous command ?  Hit it
multiple times and scroll back to earlier commands.  Then you could edit
them in place and send them just as before.  I had been thinking I might 
try it as a way of learning rio.

Or is there some way of doing something similar already?

ciao,

- Steve Harris



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-07-14 23:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-14 21:37 [9fans] command history Russ Cox
2000-07-14 23:24 ` Richard
  -- strict thread matches above, loose matches on Subject: below --
2000-07-14 19:44 Russ Cox
2000-07-14 14:16 Stephen C. Harris
2000-07-14 21:03 ` Richard Uhtenwoldt
2000-07-14 21:25   ` Richard Uhtenwoldt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).