zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Some problems with menu list.
Date: Tue, 15 Aug 2000 09:57:45 +0200 (MET DST)	[thread overview]
Message-ID: <200008150757.JAA05041@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Tue, 15 Aug 2000 11:26:57 +0400


Andrej Borsenkow wrote:

> I played with porcesses and processes-list and something was wrong with list
> display.

The problem isn't `menu list', but process completion, of course.

> bor@itsrm2% kill 13996
> Completing process ID
>      bor  2921  2548  0 09:52:22 ?        0:00 /usr/dt/bin/Xsession

You must have tweaked _pids to be able to get this list. Something
like the patch below, which I'll commit, even though this isn't the
final answer.

> ...
> 
> bor@itsrm2% kill 12474
>
> ...
>
>     root 14006 14000  0   Jul 31 ?        0:00 telemon
>     root 24038 14006  0   Jul 31 term/tc4p0t2  0:00 /opt/lib/tele/saf/dialer
> 12474   13038
> 
> note two "leftover" numbers. They represent valid processes:
> 
> bor@itsrm2% ps -fp 13038,12474
>      UID   PID  PPID  C    STIME TTY      TIME CMD
>      bor 13038 12559  0 11:17:22 pts/12   0:05 zsh
>      bor 12474 12406  0 10:51:47 pts/10   0:02 info
> 
> May be, it a problem with my style(s); BTW processes and processes-list
> definitely needs better documentation (e.g. processes expects first line to be
> heading and process numbers in the first column). I have full list of current
> processes and can send on request (it is rather large just to include it).

The problem is with calling ps twice, race conditions and whatnot.

I was never really happy with this. Initially I did that to be able to 
list processes without showing their ids. Rather stupid, I admit,
especially because _pids has evolved since then to not be able to show 
lists without the pids.

Question to everyone: should we remove processes-list, i.e. the second 
call to ps? The problem is: how do we replace it. I think it would be
nice if _pids would look at the first line of the output of ps to see
which column gives the pids. If it can't find that out, it uses the
first numeric column (easier to implement: the first number in each
line). For special cases, users should be able to set a style to tell
_pids which column to use.

Would that be ok for everyone?


Bye
 Sven

Index: Completion/Builtins/_pids
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_pids,v
retrieving revision 1.6
diff -u -r1.6 _pids
--- Completion/Builtins/_pids	2000/06/20 07:15:38	1.6
+++ Completion/Builtins/_pids	2000/08/15 07:50:49
@@ -9,11 +9,11 @@
 
 if [[ "$1" = -m ]]; then
   all=()
-  match="[[:blank:]]#${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*[/[:blank:]]${2}*"
+  match="*[[:blank:]]${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*[/[:blank:]]${2}*"
   shift 2
 elif [[ "$PREFIX$SUFFIX" = [0-9]# ]]; then
   all=()
-  match="[[:blank:]]#${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*"
+  match="*[[:blank:]]${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*"
 else
   all=(-U)
   match="*[[:blank:]]*[[/[:blank:]]$PREFIX*$SUFFIX*"

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-08-15  7:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-15  7:57 Sven Wischnowsky [this message]
2000-08-15  8:35 ` Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
2000-08-15  7:26 Andrej Borsenkow

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=200008150757.JAA05041@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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