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

exiting fish causes calling aplication to suspend #197

Closed
maxfl opened this issue Jul 1, 2012 · 9 comments
Closed

exiting fish causes calling aplication to suspend #197

maxfl opened this issue Jul 1, 2012 · 9 comments
Milestone

Comments

@maxfl
Copy link
Contributor

maxfl commented Jul 1, 2012

This is an old and strange bug, which is not that harmful, but rather annoying.

One can use the following python code to illustrate it:

from os import system
system('fish')

In fish type exit and see the message:
Job 1, “ipython” has stopped
Then you need to call 'fg' to put the program back to foreground.

The same happens if I use subprocess module of if I use another languages (lua: 'os.execute "fish"').

@ridiculousfish
Copy link
Member

I'm not able to reproduce this

@maxfl
Copy link
Contributor Author

maxfl commented Jul 15, 2012

I've tested the latest version. The problem still exists.
Do you run on Mac? Can you try other systems/terminal emulators?

@siteshwar
Copy link
Contributor

I am running Linux and able to reproduce this bug.

@smlx
Copy link
Contributor

smlx commented Aug 12, 2012

I am not able to reproduce this on debian wheezy. Possible regression?

Edit: scratch that. I see it now.

@ridiculousfish
Copy link
Member

Oh, I see, you have to run the Python code from the repl. A script file won't reproduce it.

@ridiculousfish
Copy link
Member

This code is triggering it:

/* Grab control of the terminal.  */
if( tcsetpgrp (STDIN_FILENO, shell_pgid) )

@ridiculousfish
Copy link
Member

Minimal program that reproduces this:

#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>

int main(void) {
    setpgid(0, getpid());
    signal(SIGTTOU, SIG_IGN);
    tcsetpgrp (STDIN_FILENO, getpid());
    return 0;
}

@ridiculousfish
Copy link
Member

I can reproduce these symptoms with other shells by sending them SIGKILL instead of allowing them to exit gracefully. I conclude they must be saving and restoring the process controlling terminal manually.

@ridiculousfish
Copy link
Member

I added the same and it seems to fix the problem.

To git@github.com:fish-shell/fish-shell.git
b79854a..c9c2fc5 master -> master

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants