Skip to content

Job id expansion fails for mixed process/function pipelines #10832

@mqudsi

Description

@mqudsi
> function test_jobs; end;
> cat | test_jobs &
fish: Job 1, 'cat | test_jobs &' has stopped
> jobs
Job     Group   CPU     State   Command
1       77562   0%      stopped cat | test_jobs &
> fg %1
fg: No suitable job: 0
> jobs -p %1
77562
0

The problem is that __fish_expand_pid_args returns pids 77625 and the invalid/incorrect 0 for the one job that is running (in that order), and the fg function forwards only the last value to the actual fg command (fg $args[-1]).

jobs -p 0 naturally fails with jobs: No suitable job: 0

We can hack around this by filtering out 0 in __fish_expand_pid_args, but we might want to stop emitting 0 altogether in jobs -p.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions