8000 Remove or improve process expansion (`%something`) · Issue #4230 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

Remove or improve process expansion (%something) #4230

@faho

Description

@faho

As discussed on gitter by @floam, @krader1961 and me:

We should either improve process expansion so that it is usable, or remove it ("juice it or lose it").

Improving it would entail:

  • Add some way to silence the error when no matching process is found (maybe the same as with globs - only allow with for, set and count)

  • Add some way to use it as part of a word (this would be a big incompatible change)

Removing it would remove a bunch of code. Note that there is also "job expansion", which isn't quite the same thing. E.g. %1 expands not to a process with "1" in its name, but the job with id 1. If that is to be removed as well, this would free up "%" as a special character.

Because of the annoying error, process expansion remains basically unused in fish scripts with one exception: %self. This should be replaced with a variable (see #1202).

In case we consider the POSIX standard way to get a PID from a part of a process COMM to be too odious (as far as I can tell it requires scraping ps output), it would be possible to provide a pidof command instead.

Now fight discuss.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0