Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function: restore '%self' functionality for --on-process-exit #4952

Closed

Conversation

zanchey
Copy link
Member

@zanchey zanchey commented Apr 29, 2018

This PR restores "%self" as an argument for --on-process/--on-process-exit.

It also adds "self" as a more sensible alias, but perhaps this could be dropped in favour of using $fish_pid.

One key use of process expansion, used in currently-shipped code, is for running a function on
current shell exit.

Restore the use of %self as a valid argument (and add `self`) and document this change.
@zanchey zanchey added this to the fish-3.0 milestone Apr 29, 2018
@zanchey
Copy link
Member Author

zanchey commented Apr 29, 2018

%self gets a reasonable amount of use and this saves a few of them from exploding - notably virtualfish.

@mqudsi
Copy link
Contributor

mqudsi commented Apr 29, 2018

Thanks for doing this, @zanchey. Isn't --on-process-exit on its way out, though? I'd be fine with restoring compatibility for %self for now, but given that it's being deprecated in favor of events, I wouldn't expand its functionality any more than that.

Perhaps we should also print a warning message about the deprecation of %self and --on-process-exit to the tty...

@ridiculousfish
Copy link
Member

What's the alternative way of doing this with events?

@faho
Copy link
Member

faho commented Apr 29, 2018

@ridiculousfish: The alternative to function foo --on-process-exit %self is function foo --on-event fish_exit.

I added that one in b67a614 (which does not actually "replace" anything, don't believe the commit message).

@faho
Copy link
Member

faho commented May 5, 2018

@zanchey: I think we don't want to add additional functionality to this, since I want to get away from it - and I haven't heard any disagreement.

So I'd merge it without the self part, unless @ridiculousfish wants to add the % stuff to #4940.

@zanchey
Copy link
Member Author

zanchey commented May 8, 2018

SGTM.

@faho
Copy link
Member

faho commented May 8, 2018

Merged without the "self" stuff as 21890cc.

@faho faho closed this May 8, 2018
@zanchey zanchey deleted the restore-function-process-self branch May 8, 2018 12:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants