From 675cec1ed2933faf23c40bfd6e6c069fe0fd6a4c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 19 Dec 2019 02:14:30 +0530 Subject: [PATCH] gst-env: Ignore SIGINT when using the fish shell After discussion with fish upstream it looks like it will take some work to fix this issue. https://github.com/fish-shell/fish-shell/pull/6426#issuecomment-567174105 In the meantime, this only happens when there's no command running in the terminal, and in that case the shell just ignores it anyway. So just do that in `gst-env.py`. Fixes https://gitlab.freedesktop.org/gstreamer/gst-build/issues/18 --- gst-env.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst-env.py b/gst-env.py index ad00cd8546..64196428be 100755 --- a/gst-env.py +++ b/gst-env.py @@ -12,6 +12,7 @@ import subprocess import sys import tempfile import pathlib +import signal from distutils.sysconfig import get_python_lib from distutils.util import strtobool @@ -384,6 +385,11 @@ if __name__ == "__main__": # Let the GC remove the tmp file args.append("--rcfile") args.append(tmprc.name) + if 'fish' in args[0]: + # Ignore SIGINT while using fish as the shell to make it behave + # like other shells such as bash and zsh. + # See: https://gitlab.freedesktop.org/gstreamer/gst-build/issues/18 + signal.signal(signal.SIGINT, lambda x, y: True) try: exit(subprocess.call(args, close_fds=False, env=get_subprocess_env(options, gst_version)))