9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Sending frequently used command to sam
@ 2014-08-07 11:54 Yuning Feng
  2014-08-11 20:46 ` User &
  0 siblings, 1 reply; 3+ messages in thread
From: Yuning Feng @ 2014-08-07 11:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I use sam in plan9port. I would like to wrap a sam command '.,$ > pv'
into a very short one so that I can issue it easily without searching
back in the command window. A similar command is '?\n\n?,/\n\n/ > pv',
which might better justify this shortening. To achieve my goal, I have
two ideas in mind:

1. If I can open more than one command window, than I can leave the
string in one of them, and 'send' as needed, but is this possible?

2. The manual page mentions that sam listens to the edit port of plumb
or sam.user named pipe. If they are available, I can communicate to
sam by them. However, for the named pipe, I am not able to find
sam.user in /tmp/ns.(username).:0, where the font server lives in. For
the plumb, it is a little magical to me and I scratched my head and
tried for a while but not getting anywhere.

Hopefully some of you could shed me some light.

Yuning



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

* Re: [9fans] Sending frequently used command to sam
  2014-08-07 11:54 [9fans] Sending frequently used command to sam Yuning Feng
@ 2014-08-11 20:46 ` User &
  2014-08-12 15:13   ` Yuning Feng
  0 siblings, 1 reply; 3+ messages in thread
From: User & @ 2014-08-11 20:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

With no plumber running
  % echo 'B /etc/passwd' > /tmp/.sam.$USER.$DISPLAY
sends text to command window.

Hope this can help!
See $PLAN9/src/cmd/samterm/plan9.c:/^extstart called
from io.c in case plumbstart() fail, as stated in sam(1).

With plumber running:
  % echo /etc/passwd| plumb -i -d edit -a action=showfile
Reading $PLAN/src/cmd/samterm/plan9.c:/^plumbformat, seems
you can't do much but 'showfile' for now :-)

After a quick look to the code, I doubt one can easily have
more than a single command window.

On Thu, Aug 07, 2014 at 01:54:17PM +0200, Yuning Feng wrote:
> I use sam in plan9port. I would like to wrap a sam command '.,$ > pv'
> into a very short one so that I can issue it easily without searching
> back in the command window. A similar command is '?\n\n?,/\n\n/ > pv',
> which might better justify this shortening. To achieve my goal, I have
> two ideas in mind:
>
> 1. If I can open more than one command window, than I can leave the
> string in one of them, and 'send' as needed, but is this possible?
>
> 2. The manual page mentions that sam listens to the edit port of plumb
> or sam.user named pipe. If they are available, I can communicate to
> sam by them. However, for the named pipe, I am not able to find
> sam.user in /tmp/ns.(username).:0, where the font server lives in. For
> the plumb, it is a little magical to me and I scratched my head and
> tried for a while but not getting anywhere.
>
> Hopefully some of you could shed me some light.
>
> Yuning
>



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

* Re: [9fans] Sending frequently used command to sam
  2014-08-11 20:46 ` User &
@ 2014-08-12 15:13   ` Yuning Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Yuning Feng @ 2014-08-12 15:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

This is a perfect answer. Thanks!

Yuning



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

end of thread, other threads:[~2014-08-12 15:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-07 11:54 [9fans] Sending frequently used command to sam Yuning Feng
2014-08-11 20:46 ` User &
2014-08-12 15:13   ` Yuning Feng

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).