Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] add the full range of OpenBSD ptys



When more than 15 terminals (tty**) are opened with the default setting
of OpenBSD, zpty module throws an error like:
****
(zpty):zpty:2: can't open pseudo terminal: device not configured
****
This was caused mainly by the limited list of char1[] and char2[]
which didn't represent the full range of OpenBSD tty's names.

The above is highlighted when zpty is used by the shell prompt[1] .
Feedback are always appreciated!

Regards,
Thierry

[1] https://github.com/sindresorhus/pure
---
 Src/Modules/zpty.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 3c1bef58f..1c93a1d02 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -254,7 +254,12 @@ get_pty(int master, int *retfd)
 #elif defined(__FreeBSD__) || defined(__DragonFly__)
     static char char1[] = "pqrsPQRS";
     static char char2[] = "0123456789abcdefghijklmnopqrstuv";
-#else /* __FreeBSD__ || __DragonFly__ */
+#elif defined(__OpenBSD__)
+    static char char1[] = "pqrstuvwxyzPQRST";
+    static char char2[] = "0123456789"
+                          "abcdefghijklmnopqrstuvwxyz"
+                          "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+#else /* __FreeBSD__ || __DragonFly__  || __OpenBSD*/
     static char char1[] = "pqrstuvwxyzPQRST";
     static char char2[] = "0123456789abcdef";
 #endif
--
2.12.2



Messages sorted by: Reverse Date, Date, Thread, Author