Skip to content

feat: Allow /proc/nnn paths from shell expansion#104

Merged
basil merged 1 commit intomasterfrom
proc-pid
Mar 2, 2026
Merged

feat: Allow /proc/nnn paths from shell expansion#104
basil merged 1 commit intomasterfrom
proc-pid

Conversation

@basil
Copy link
Owner

@basil basil commented Mar 2, 2026

On Linux, /proc contains ~60 non-PID entries (acpi, cpuinfo, meminfo, etc.), so shell expansion of /proc/* produces a flood of errors. Add centralized helpers (parse_pid_arg, is_non_pid_proc_path) and use them across all tools to silently skip non-PID /proc paths, enabling the Solaris/illumos idiom of tool /proc/* to work on Linux.

Also accept /proc/PID paths in resolve_operand, resolve_operand_with_tid, and ptree, and update man page documentation accordingly.

Fixes #56

On Linux, /proc contains ~60 non-PID entries (acpi, cpuinfo, meminfo,
etc.), so shell expansion of /proc/* produces a flood of errors. Add
centralized helpers (parse_pid_arg, is_non_pid_proc_path) and use them
across all tools to silently skip non-PID /proc paths, enabling the
Solaris/illumos idiom of `tool /proc/*` to work on Linux.

Also accept /proc/PID paths in resolve_operand, resolve_operand_with_tid,
and ptree, and update man page documentation accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@basil basil added the Type: Enhancement A request, idea, or new functionality label Mar 2, 2026
@github-actions github-actions bot added Component: Process Handle Issues related to process handles Component: pargs Issues related to pargs(1) Component: pauxv Issues related to pauxv(1) Component: pcred Issues related to pcred(1) Component: penv Issues related to penv(1) Component: pfiles Issues related to pfiles(1) Component: plgrp Issues related to plgrp(1) Component: plimit Issues related to plimit(1) Component: prun Issues related to prun(1) Component: psig Issues related to psig(1) Component: pstack Issues related to pstack(1) Component: pstop Issues related to pstop(1) Component: ptime Issues related to ptime(1) Component: ptree Issues related to ptree(1) Component: pwait Issues related to pwait(1) labels Mar 2, 2026
@basil basil changed the title feat: Silently skip non-PID /proc paths from shell expansion feat: Allow /proc/nnn paths from shell expansion Mar 2, 2026
@basil basil merged commit 129f2e0 into master Mar 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: pargs Issues related to pargs(1) Component: pauxv Issues related to pauxv(1) Component: pcred Issues related to pcred(1) Component: penv Issues related to penv(1) Component: pfiles Issues related to pfiles(1) Component: plgrp Issues related to plgrp(1) Component: plimit Issues related to plimit(1) Component: Process Handle Issues related to process handles Component: prun Issues related to prun(1) Component: psig Issues related to psig(1) Component: pstack Issues related to pstack(1) Component: pstop Issues related to pstop(1) Component: ptime Issues related to ptime(1) Component: ptree Issues related to ptree(1) Component: pwait Issues related to pwait(1) Type: Enhancement A request, idea, or new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accept /proc/nnn as a process ID

1 participant