shithub: npe

Download patch

ref: 5d1e15c890a322d1beca4dcae8af685b970b7c21
parent: d0b384049457be4ace9dc7239883de23763219cc
author: Noam Preil <noam@pixelhero.dev>
date: Wed Dec 10 18:37:12 EST 2025

isatty: check if TERM is set

--- a/libnpe/isatty.c
+++ b/libnpe/isatty.c
@@ -6,5 +6,5 @@
 {
 	char buf[64];
 
-	return fd2path(fd, buf, sizeof(buf)) == 0 && strcmp(buf, "/dev/cons") == 0;
+	return fd2path(fd, buf, sizeof(buf)) == 0 && strcmp(buf, "/dev/cons") == 0 && access("/env/TERM", AEXIST) == 0;
 }
--