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

eval in config.fish inside a second instance stops the shell #5210

Closed
zanchey opened this issue Sep 25, 2018 · 5 comments · Fixed by #5219
Closed

eval in config.fish inside a second instance stops the shell #5210

zanchey opened this issue Sep 25, 2018 · 5 comments · Fixed by #5219
Labels
bug Something that's not working as intended
Milestone

Comments

@zanchey
Copy link
Member

zanchey commented Sep 25, 2018

Running 2.7.1-1449-gdeb6d477

If you have the following in your config.fish:

if status is-interactive
   eval (touch /dev/null)
end

Then when starting a new instance of fish inside an existing instance, the behaviour is as follows:

> echo $SHLVL
1
> fish
Job 1, 'fish' has stopped
> echo $SHLVL
1
> jobs
Job	Group	State	Command
1	26930	stopped	fish
> fg
Send job 1, 'fish' to foreground
zanchey@oxygen ~> echo $SHLVL
2
zanchey@oxygen ~> exit
> echo $SHLVL
1

This bites me because I have eval (python3 -m virtualfish) in my config.fish.

@zanchey zanchey added the bug Something that's not working as intended label Sep 25, 2018
@zanchey zanchey added this to the fish-3.0 milestone Sep 25, 2018
@faho
Copy link
Member

faho commented Sep 25, 2018

This bites me because I have eval (python3 -m virtualfish) in my config.fish.

That should just be python3 -m virtualfish | source. Does that work?

If it does the problem here is evals weird job control stuff.

@faho
Copy link
Member

faho commented Sep 25, 2018

Yup:

status job-control full
echo echo wurst | source # stops
status job-control interactive
echo echo wurst | source # does not

This is probably caused by fa66ac8 and friends.

@faho
Copy link
Member

faho commented Sep 25, 2018

Definitely fa66ac8. This works:

status job-control full
command echo echo wurst | source

while builtin echo command echo | source still STOPs.

I think this is an issue with our keepalive process.

@mqudsi
Copy link
Contributor

mqudsi commented Sep 26, 2018

I toyed with using owl to create a parser for fish expressions that would enable creating a logical process dependency chain to enable both simultaneous evaluation of non-dependent subshells, parallel commands, functions, or builtins and allow us to get rid of the keepalive process by instead creating a wait chain where each function only waits on the process(es) needed for its input streams to become ready but ran into two issues that prevented me from progressing down that track.

@ridiculousfish
Copy link
Member

I finally figured out how to do concurrency properly here - with a Python-style GIL (fishgil, haha). So I believe the concurrency issues will be mostly solved in 3.1.

I'll take a look at this fa66ac8-caused regression.

mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 2, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should elimante the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 8, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should elimante the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 8, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should elimante the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 8, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 8, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 9, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 10, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 10, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 11, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 13, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 15, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 18, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 19, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 20, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 22, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 24, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 27, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit to mqudsi/fish-shell that referenced this issue Oct 27, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
mqudsi added a commit that referenced this issue Oct 27, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes #4178. Fixes #3805. Fixes #5210.
ridiculousfish pushed a commit to ridiculousfish/fish-shell that referenced this issue Nov 24, 2018
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes fish-shell#4178. Fixes fish-shell#3805. Fixes fish-shell#5210.
@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.
Labels
bug Something that's not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants