Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Prompt dir expansion after removing cwd's parent
- X-seq: zsh-workers 50349
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Prompt dir expansion after removing cwd's parent
- Date: Wed, 8 Jun 2022 18:10:30 -0700
- Archived-at: <https://zsh.org/workers/50349>
- In-reply-to: <CAH+w=7Yg1rKcKN=FCiq0h1o8NU8KCuZySbHzRzhJp-rhZsQtxQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20220608091426.GA15730@tarpaulin.shahaf.local2> <1644026654.700770.1654681319674@mail2.virginmedia.com> <CAH+w=7Yg1rKcKN=FCiq0h1o8NU8KCuZySbHzRzhJp-rhZsQtxQ@mail.gmail.com>
On Wed, Jun 8, 2022 at 9:15 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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 ]]
do
if [[ -r $filename ]]
then
read -t 1 filename
else
print -r -- $filename
read filename
fi
done
# --- >8 ---
Messages sorted by:
Reverse Date,
Date,
Thread,
Author