From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1231 invoked by alias); 17 May 2016 16:48:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38510 Received: (qmail 10535 invoked from network); 17 May 2016 16:48:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=rvYdzBo2Hl0mYy5pjZ56Hdj6rlg3Fixn9wx+kVdsTkw=; b=ADR6X0ZSQstgd+cWydkMPVYXUH7MLOY4QkDZppOLCawLhg/OmXVShLwNmKZ1mEhszI GH6gNGxDHgB9dBjCnVXsG/nZYzNLkqlml79ZEZM/uGwrMfCxfvG/vMmVftRDYEJYC4yW YjMqaMFuHa1XqXBeyZIcGG5sjBiMvK3FieM5sm+isabBHG6+yIx3fWrwilRLUY9upxmb JOaTdFeEyB2ockhbf1DDSMP+6WtHCyz18aB/xji/66mQXJnYdvdQphsnuC8VvxY1ZEPl +Cc2/hqJigxhgGqXRHN55RWcO9Hek1o+6zL14wZLE3KuEys8DuJJp9DgV+J07a/Fwtpy edRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=rvYdzBo2Hl0mYy5pjZ56Hdj6rlg3Fixn9wx+kVdsTkw=; b=HNhVZXdnxk7JYdLp2m6/gwoVo5733KNqV4v9vLKyJFr+rocX6E9Y1JjtUCKBKD2uTY Ybvkurvw3D1ZUYbAAZNOgrld8/lQVh2vw037OSmBQXp+db7MmWe20uQoJtSitmKz7zP4 +tTj+OfS04KdCOsjo1ISWESRqpJdeTx7CjIQb8h2xZRL4rXk8/Xa1JQU/VxoG04McOPh cHxKBipVD3pg2cHkgcXOX49ztq4dHHsMWW3L/xUYy8yK6MWlDXidlLNVei+qXv7npB5T sqlgsqzLc+CSfFJN5C8yv7BY2jUoTa49PqGmqY+GyJyruuUfzQFHXfmigtdLrbJC8kC7 CM8w== X-Gm-Message-State: AOPr4FU1hQlG92cc6dKGpXrbpU4G328OXcchxX5AIsNWvvQLezZMwEUnfmqfujVEzm41lKU8c91fO0XMrOd2QA== MIME-Version: 1.0 X-Received: by 10.55.192.71 with SMTP id o68mr2757550qki.27.1463503705003; Tue, 17 May 2016 09:48:25 -0700 (PDT) In-Reply-To: <573AF76D.2010106@redhat.com> References: <573AF76D.2010106@redhat.com> Date: Tue, 17 May 2016 18:48:24 +0200 Message-ID: Subject: Re: zsh pid completion From: Mikael Magnusson To: Marko Myllynen Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Tue, May 17, 2016 at 12:50 PM, Marko Myllynen wrote: > Hi, > > I see that _pids completion offers only a very limited subset of the > running pids (even by the same user). For example, if I launch a command > on a terminal its PID is not included in completion alternatives on > another terminal. Also, when root, in some cases it might be beneficial > to offer also non-root PIDs (perhaps this could be configurable). > > Is there some reason for this limited approach? (I'm not sending any > patches yet, I'm afraid with ps(1) portability might be a bit tricky.) No need for a patch, you can just set a style to run whatever ps command you like to generate the matches, i use: zstyle ':completion:*:processes' command 'ps ax -o user,pid,nice,%cpu,%mem,vsz,rss,tname,stat,start,time,command --sort=-%cpu' These are also possible zstyle ':completion:*:processes' command 'ps aux' zstyle ':completion:*:processes' command 'ps --forest -A -o pid,user,cmd' -- Mikael Magnusson