Browse Source

add support for msys2

adam j hartz 1 year ago
parent
commit
17d526ef5f
2 changed files with 6 additions and 4 deletions
  1. 4
    4
      takoshell/jobs.py
  2. 2
    0
      takoshell/platform.py

+ 4
- 4
takoshell/jobs.py View File

@@ -28,7 +28,7 @@ import signal
28 28
 import builtins
29 29
 from collections import deque
30 30
 
31
-from takoshell.platform import ON_DARWIN, ON_CYGWIN
31
+from takoshell.platform import ON_DARWIN, ON_CYGWIN, ON_MSYS
32 32
 
33 33
 tasks = deque()
34 34
 # Track time stamp of last exit command, so that two consecutive attempts to
@@ -46,7 +46,7 @@ if ON_DARWIN:
46 46
                 continue
47 47
             os.kill(pid, signal)
48 48
 
49
-elif ON_CYGWIN:
49
+elif ON_CYGWIN or ON_MSYS:
50 50
     # Similar to what happened on OSX, more issues on Cygwin
51 51
     # (see Github issue #514).
52 52
     def _send_signal(job, signal):
@@ -106,9 +106,9 @@ _block_when_giving = (signal.SIGTTOU, signal.SIGTTIN,
106 106
 # _give_terminal_to is a simplified version of:
107 107
 #    give_terminal_to from bash 4.3 source, jobs.c, line 4030
108 108
 # this will give the terminal to the process group pgid
109
-if ON_CYGWIN:
109
+if ON_CYGWIN or ON_MSYS:
110 110
     import ctypes
111
-    _libc = ctypes.CDLL('cygwin1.dll')
111
+    _libc = ctypes.CDLL('cygwin1.dll' if ON_CYGWIN else 'msys-2.0.dll')
112 112
 
113 113
     # on cygwin, signal.pthread_sigmask does not exist in Python, even
114 114
     # though pthread_sigmask is defined in the kernel.  thus, we use

+ 2
- 0
takoshell/platform.py View File

@@ -41,6 +41,8 @@ ON_LINUX = platform.system() == 'Linux'
41 41
 """ ``True`` if executed on a Linux platform, else ``False``. """
42 42
 ON_CYGWIN = sys.platform == 'cygwin'
43 43
 """ ``True`` if executed on a Cygwin Windows platform, else ``False``. """
44
+ON_MSYS = sys.platform == 'msys'
45
+""" ``True`` if executed on an MSYS Windows platform, else ``False``. """
44 46
 
45 47
 
46 48
 #

Loading…
Cancel
Save