dalance / procs

A modern replacement for ps written in Rust
MIT License
5.2k stars 118 forks source link

zsh autocompletion not work #641

Open Alsan opened 6 months ago

Alsan commented 6 months ago

I've try source <(procs --gen-completion-out zsh) under zsh and no any suggestion shown, and the same procedure works under bash. I'm using procs 0.14.5

dalance commented 4 months ago

I checked the issue. Do you mean that procs <TAB> don't show anything? If so, this is expected behaviour because procs takes arbitrary string for process filtering as argument.

If you type procs -<TAB>, the available options will be shown like below:

$ procs -<TAB>
--and                 -a  -- AND  logic for multi-keyword
--color               -c  -- Color mode
--debug                   -- Show debug message
--gen-completion          -- Generate shell completion file
--gen-completion-out      -- Generate shell completion file and write to stdout
--gen-config              -- Generate configuration sample file
--help                -h  -- Print help (see more with '--help')
--insert              -i  -- Insert column to slot
--interval                -- Interval to calculate throughput
--list                -l  -- Show list of kind
--load-config             -- Load configuration from file
--nand                -d  -- NAND logic for multi-keyword
--no-header               -- Suppress header
--nor                 -r  -- NOR  logic for multi-keyword
--only                    -- Specified column only
--or                  -o  -- OR   logic for multi-keyword
--pager               -p  -- Pager mode
--sorta                   -- Sort column by ascending
--sortd                   -- Sort column by descending
--theme                   -- Theme mode
--thread                  -- Show thread
--tree                -t  -- Tree view
--use-config              -- Use built-in configuration
--version             -V  -- Print version
--watch               -w  -- Watch mode with default interval (1s)
--watch-interval      -W  -- Watch mode with custom interval
skull-squadron commented 1 month ago

procs[TAB] -> Adds a space to complete the command itself but then shows nothing

image

procs -[TAB] -> shows completions

image

Perhaps the author would consider git-like completions that do not require a leading - to complete, but completions do work.