help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Prompt dir expansion after removing cwd's parent
Date: Wed, 8 Jun 2022 18:10:30 -0700	[thread overview]
Message-ID: <CAH+w=7Z8BHUEhNwPcKBGwEA_a5OPKbf2c-4vs=KyeN40+aHseQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Yg1rKcKN=FCiq0h1o8NU8KCuZySbHzRzhJp-rhZsQtxQ@mail.gmail.com>

On Wed, Jun 8, 2022 at 9:15 AM Bart Schaefer <schaefer@brasslantern.com> wrote:
> If you're doing this to
> yourself often enough to notice, put something in your precmd hooks to
> discover it.

SGI IRIX (y'all have seen Jurassic Park, ya?) had this thing called
FAM, the File Access Monitor.  Here's a really dumb version of that.

# --- 8< --- zFAM
# Example Usage
#    coproc zFAM
#    chpwd() { pwd -P >&p }
#    precmd() { read -t 0 -p && print -ru2 -- $REPLY not readable }

typeset filename
read filename    # Wait forever for first file to monitor

while [[ -n $filename ]]
    if [[ -r $filename ]]
      read -t 1 filename
      print -r -- $filename
      read filename
# --- >8 ---

      reply	other threads:[~2022-06-09  1:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  9:14 Daniel Shahaf
2022-06-08  9:41 ` Peter Stephenson
2022-06-08 16:15   ` Bart Schaefer
2022-06-09  1:10     ` Bart Schaefer [this message]

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:

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

  git send-email \
    --in-reply-to='CAH+w=7Z8BHUEhNwPcKBGwEA_a5OPKbf2c-4vs=KyeN40+aHseQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \


* 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.
Code repositories for project(s) associated with this public inbox


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