is a program that mounts itself over a
service mounted at
and filters incoming messages according to the rules provided on the command line.
accepts an arbitrary number of argument pairs; each pair consists of a port name
and a regular expression
Each incoming message that does not match
can be optionally prefixed by
to indicate logical inversion (i.e. messages matching the regexp are discarded).
instance dedicated to editing kernel source code:
ptrap edit '^/sys/src/9/'
In another window, start a second
instance for all other editing jobs:
ptrap edit '!^/sys/src/9/'
Multiple filters specified on the same port ignore all but the last one.
would be more useful if it could inhibit sending the message to other clients.
As far as
is concerned, even messages dropped by
are "accepted", which means rules that are supposed to apply to messages not accepted by clients are not invoked (e.g. a rule starting an editor if no one is listening to the
port will not work if there is a
on that port).
first appeared in 9front (February, 2018).