Index: makefile
===================================================================
--- makefile	(version 2026.08.10)
+++ makefile
@@ -98,11 +98,12 @@
 	nul := /dev/null
 
 	kernel := $(shell uname -s)
+	machine := $(shell uname -m)
+
 	ifeq "$(kernel)" "Linux"
 
 		environment := linux.cpp posix.cpp ansi.cpp
 
-		machine := $(shell uname -m)
 		ifeq "$(machine)" "i686"
 			hostenvironments := amd32linux
 		else ifeq "$(machine)" "x86_64"
@@ -126,7 +127,7 @@
 	else ifeq "$(kernel)" "Darwin"
 
 		environment := darwin.cpp posix.cpp ansi.cpp
-		machine := $(shell uname -m)
+
 		ifeq "$(machine)" "i686"
 			hostenvironments := amd32darwin
 		else ifeq "$(machine)" "x86_64"
@@ -150,6 +151,28 @@
 			toolchain := clang
 		endif
 
+	else ifdef MSYSTEM
+
+		environment := linux.cpp posix.cpp ansi.cpp
+
+		ifeq "$(machine)" "i686"
+			hostenvironments := win32
+		else ifeq "$(machine)" "x86_64"
+			hostenvironments := win64
+		else
+			hostenvironments :=
+		endif
+
+		ifndef toolchain
+			ifeq "$(MSYSTEM)" "CLANG64"
+				toolchain := clang
+			else ifeq "$(MSYSTEM)" "CLANGARM64"
+				toolchain := clang
+			else
+				toolchain := gcc
+			endif
+		endif
+
 	else
 		environment := $(error unknown posix environment)
 	endif
Index: tools/driver.hpp
===================================================================
--- tools/driver.hpp	(version 2026.08.10)
+++ tools/driver.hpp
@@ -51,7 +51,6 @@
 #include "error.hpp"
 #include "format.hpp"
 
-#include <cstdio>
 #include <cstdlib>
 #include <fstream>
 #include <iostream>
@@ -61,6 +60,7 @@
 #if __has_include (<unistd.h>)
 	#include <unistd.h>
 #elif __has_include (<io.h>)
+	#include <cstdio>
 	#include <io.h>
 #endif
 
@@ -94,8 +94,10 @@
 
 	if (!last)
 	{
-		#if __has_include (<unistd.h>) || __has_include (<io.h>)
-			if (isatty (fileno (stdin)) && isatty (fileno (stdout)))
+		#if __has_include (<unistd.h>)
+			if (isatty (STDIN_FILENO) && isatty (STDOUT_FILENO))
+		#elif __has_include (<io.h>)
+			if (_isatty (_fileno (stdin)) && _isatty (_fileno (stdout)))
 		#endif
 
 		std::cout << name << " Build " __DATE__ " Copyright (C) Florian Negele\n"
Index: utilities/linux.cpp
===================================================================
--- utilities/linux.cpp	(version 2026.08.10)
+++ utilities/linux.cpp
@@ -16,6 +16,8 @@
 // You should have received a copy of the GNU General Public License
 // along with the ECS.  If not, see <https://www.gnu.org/licenses/>.
 
+#define _POSIX_C_SOURCE 200809L
+
 #include "system.hpp"
 
 #include <climits>
@@ -25,14 +27,19 @@
 
 const char* sys::get_name ()
 {
-	struct utsname name;
-	if (uname (&name)) return nullptr;
-	if (!std::strcmp (name.machine, "i686")) return "amd32linux";
-	if (!std::strcmp (name.machine, "x86_64")) return "amd64linux";
-	if (!std::strcmp (name.machine, "armv7l")) return "arma32linux";
-	if (!std::strcmp (name.machine, "armv8l")) return "arma32linux";
-	if (!std::strcmp (name.machine, "aarch64")) return "arma64linux";
-	if (!std::strcmp (name.machine, "mips")) return "mips32linux";
+	struct utsname name; if (uname (&name)) return nullptr;
+	if (!std::strcmp (name.sysname, "Linux"))
+		if (!std::strcmp (name.machine, "i686")) return "amd32linux";
+		else if (!std::strcmp (name.machine, "x86_64")) return "amd64linux";
+		else if (!std::strcmp (name.machine, "armv7l")) return "arma32linux";
+		else if (!std::strcmp (name.machine, "armv8l")) return "arma32linux";
+		else if (!std::strcmp (name.machine, "aarch64")) return "arma64linux";
+		else if (!std::strcmp (name.machine, "mips")) return "mips32linux";
+		else;
+	else if (!std::strncmp (name.sysname, "MINGW", 5) || !std::strncmp (name.sysname, "MSYS", 4))
+		if (!std::strcmp (name.machine, "i686")) return "win32";
+		else if (!std::strcmp (name.machine, "x86_64")) return "win64";
+		else;
 	return nullptr;
 }
 
Index: utilities/posix.cpp
===================================================================
--- utilities/posix.cpp	(version 2026.08.10)
+++ utilities/posix.cpp
@@ -16,6 +16,8 @@
 // You should have received a copy of the GNU General Public License
 // along with the ECS.  If not, see <https://www.gnu.org/licenses/>.
 
+#define _POSIX_C_SOURCE 200809L
+
 #include "ansi.hpp"
 #include "system.hpp"
 
@@ -33,10 +35,10 @@
 
 namespace sys
 {
-	struct file {int fd = -1; ~file () {if (fd != -1) close (fd);} void read (std::string& string) {if (int size; fd != -1 && !ioctl (fd, FIONREAD, &size)) string.resize (size), ::read (fd, string.data (), size); else string.clear ();}};
+	struct file {int fd = -1; ~file () {close ();} void close () {if (fd != -1) ::close (fd), fd = -1;} void read (std::string& string) {string.clear (); std::array<char, 128> buffer; while (const auto size = ::read (fd, buffer.data (), buffer.size ())) if (size > 0) string.append (buffer.data (), buffer.data () + size); else break;}};
 	struct pipe {file in, out; pipe () {::pipe (&in.fd);}};
 	struct duplicate : file {const int original; explicit duplicate (const int o) : file {dup (o)}, original {o} {} void redirect (const int to) {if (original != -1 && to != -1) dup2 (to, original);}};
-	struct capture : pipe, duplicate {std::string& string; capture (const int stream, std::string& s) : duplicate {stream}, string {s} {redirect (out.fd);} ~capture () {in.read (string); redirect (fd);}};
+	struct capture : pipe, duplicate {std::string& string; capture (const int stream, std::string& s) : duplicate {stream}, string {s} {redirect (out.fd);} ~capture () {redirect (fd); out.close (); in.read (string);}};
 	struct output : capture {static output* current; output (const int stream, std::string& s) : capture {stream, s} {current = this;} ~output () {current = nullptr;} void acquire () {redirect (out.fd);} void release () {redirect (fd);}};
 }
 
Index: utilities/windows.cpp
===================================================================
--- utilities/windows.cpp	(version 2026.08.10)
+++ utilities/windows.cpp
@@ -22,7 +22,6 @@
 
 #include <array>
 #include <cstdlib>
-#include <io.h>
 #include <iostream>
 #include <windows.h>
 
@@ -40,8 +39,7 @@
 
 const char* sys::get_name ()
 {
-	SYSTEM_INFO info;
-	GetNativeSystemInfo (&info);
+	SYSTEM_INFO info; GetNativeSystemInfo (&info);
 	if (info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) return "win32";
 	if (info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return "win64";
 	return nullptr;
@@ -79,14 +77,14 @@
 
 bool sys::is_terminal (const std::ios& stream)
 {
-	return &stream == &std::cin && _isatty (_fileno (stdin)) || &stream == &std::cout && _isatty (_fileno (stdout)) || &stream == &std::cerr && _isatty (_fileno (stderr));
+	const auto nStdHandle = &stream == &std::cin ? STD_INPUT_HANDLE : &stream == &std::cout ? STD_OUTPUT_HANDLE : &stream == &std::cerr ? STD_ERROR_HANDLE : 0;
+	return nStdHandle && GetFileType (GetStdHandle (nStdHandle)) == FILE_TYPE_CHAR;
 }
 
 std::ostream& sys::operator << (std::ostream& stream, const color color)
 {
-	if (!is_terminal (stream)) return stream;
 	const auto nStdHandle = &stream == &std::cout ? STD_OUTPUT_HANDLE : &stream == &std::cerr ? STD_ERROR_HANDLE : 0; if (!nStdHandle) return stream;
-	const auto hConsoleOutput = GetStdHandle (nStdHandle); if (hConsoleOutput == NULL || hConsoleOutput == INVALID_HANDLE_VALUE) return stream;
+	const auto hConsoleOutput = GetStdHandle (nStdHandle); if (GetFileType (hConsoleOutput) != FILE_TYPE_CHAR) return stream;
 	enum Color : WORD {Normal, Black = FOREGROUND_INTENSITY, Red = FOREGROUND_RED | FOREGROUND_INTENSITY, Blue = FOREGROUND_BLUE | FOREGROUND_INTENSITY, Green = FOREGROUND_GREEN | FOREGROUND_INTENSITY, Cyan = Blue | Green, Magenta = Red | Blue, Yellow = Red | Green, White = Red | Green | Blue, Invalid = 0xffff};
 	static constexpr std::array colors {Black, Blue, Cyan, Green, Magenta, Normal, Red, White, Yellow};
 	static WORD attributes[] {Invalid, Invalid}; auto& attribute = attributes[nStdHandle - STD_ERROR_HANDLE];
