Commit 17d526ef authored by adam j hartz's avatar adam j hartz

add support for msys2

parent 11c0bdb3
......@@ -28,7 +28,7 @@ import signal
import builtins
from collections import deque
from takoshell.platform import ON_DARWIN, ON_CYGWIN
from takoshell.platform import ON_DARWIN, ON_CYGWIN, ON_MSYS
tasks = deque()
# Track time stamp of last exit command, so that two consecutive attempts to
......@@ -46,7 +46,7 @@ if ON_DARWIN:
continue
os.kill(pid, signal)
elif ON_CYGWIN:
elif ON_CYGWIN or ON_MSYS:
# Similar to what happened on OSX, more issues on Cygwin
# (see Github issue #514).
def _send_signal(job, signal):
......@@ -106,9 +106,9 @@ _block_when_giving = (signal.SIGTTOU, signal.SIGTTIN,
# _give_terminal_to is a simplified version of:
# give_terminal_to from bash 4.3 source, jobs.c, line 4030
# this will give the terminal to the process group pgid
if ON_CYGWIN:
if ON_CYGWIN or ON_MSYS:
import ctypes
_libc = ctypes.CDLL('cygwin1.dll')
_libc = ctypes.CDLL('cygwin1.dll' if ON_CYGWIN else 'msys-2.0.dll')
# on cygwin, signal.pthread_sigmask does not exist in Python, even
# though pthread_sigmask is defined in the kernel. thus, we use
......
......@@ -41,6 +41,8 @@ ON_LINUX = platform.system() == 'Linux'
""" ``True`` if executed on a Linux platform, else ``False``. """
ON_CYGWIN = sys.platform == 'cygwin'
""" ``True`` if executed on a Cygwin Windows platform, else ``False``. """
ON_MSYS = sys.platform == 'msys'
""" ``True`` if executed on an MSYS Windows platform, else ``False``. """
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment