9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Silas McCroskey <inkswinc@gmail.com>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] A few questions about sam
Date: Thu, 22 Jul 2021 16:45:12 -0700	[thread overview]
Message-ID: <CAHjwAuzxqMt0HW8SisHHSN-dWegUd08KJm+n5jv1ANLHo39CAg@mail.gmail.com> (raw)
In-Reply-To: <16269851390.DBFd5AcC9.900602@composer.9fans.topicbox.com>

> The sam window is not always responsive to commands. Under what specific conditions is this the case?

I can think of a few cases:

* You issued an I/O command (shell, read file, write file, etc.) and
it's still in progress (there will always be output you can wait for
in these cases, e.g. the second '!' for shell commands). There's no
way I know of to kill an issued command from within sam (e.g. del key
doesn't work); if you launched something that's infinite looping or
the like you'd have to find it via ps and send a signal/note.
* You're entering commands on something other than the last line
("history" is editable, as in normal plan 9 terminals, which can be
particularly confusing in sam, as there's no prompt).
* You've started a compound command spanning multiple lines (e.g. with
{ } braces) and haven't completed it yet.

> is there a way to repeat the last entered command in sam without having to snarf and paste? I know one can repeat the last search with //.

Not that I know of, sadly. Bare 's' to repeat is one of the things I
miss most about ed. Samterm's 'send' (send the highlighted text (or
the current snarf buffer) for execution) might be a slightly faster
idiom than snarf+paste+enter, though.

> In ed the "e" command allows one to switch files. It replaces the current file with another. To add a file to the list in sam, one should use B not e. Is that correct? I.e. it would seem "e" is allowed but not sam's natural way of doing things?

B and b are both useful for this, yes. The former will load a new file
if that path isn't already in the menu, the latter will only switch to
already-loaded files.

'b' can be combined with X to good effect, in spite of that clearly
not being an anticipated case:
X/pathregex/b

will print "?blank expected" but still switch to the file matching
pathregex, so you don't need to type (or copy+paste) the full path.

- Silas

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T60b5c1929a63b077-Mf5cfe43f0a56bf959f4d436a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

  reply	other threads:[~2021-07-22 23:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 13:38 revcomninos
2021-07-22 13:57 ` Sigrid Solveig Haflínudóttir
2021-07-22 14:59   ` revcomninos
2021-07-22 19:10 ` mcz
2021-07-22 19:18   ` Charles Forsyth
2021-07-22 19:24 ` Charles Forsyth
2021-07-22 20:18   ` revcomninos
2021-07-22 23:45     ` Silas McCroskey [this message]
2021-07-23  4:47       ` revcomninos
2021-07-23  5:42         ` Silas McCroskey
2021-07-23  9:53           ` revcomninos
2021-07-27  0:56 ` Ethan Gardener
2021-07-27  6:34   ` revcomninos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHjwAuzxqMt0HW8SisHHSN-dWegUd08KJm+n5jv1ANLHo39CAg@mail.gmail.com \
    --to=inkswinc@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).