Skip to content

Remove process-exit event (function --on-process) #4700

Closed
@faho

Description

@faho

As we've seen in #4582, there's a few issues with the process-exit event.

This thing:

function on_exit --on-process $PID
    # do stuff
end
  • It currently hangs WSL if fish is configured as the login shell (since it gets PID 2) - which we can fix

  • It is only triggered for the leading process of a job - which we can fix, but that would then send more events that nobody listens to

But more importantly: It is fundamentally broken. It requires either getting the PID from fish - in which case one could just use the job-id instead - or guessing the PID (which does not work). It can also only ever work for fish's children.

It seems like this is only ever used to do stuff when fish exits (--on-process %self - also in OMF and fisherman repositories), so I would propose to make that explicit.

So here's what I'm planning to do:

  • Remove the general "EVENT_EXIT" event - in the future, no need to rush this

  • Introduce a more specific "--on-fish-exit" switch and corresponding event (or just simply a "fish_exit" event)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions