zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] add the full range of OpenBSD ptys
@ 2017-09-11  3:09 ` Thierry Ghelew
  2017-09-11  9:16   ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Ghelew @ 2017-09-11  3:09 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] add the full range of OpenBSD ptys
  2017-09-11  3:09 ` [PATCH] add the full range of OpenBSD ptys Thierry Ghelew
@ 2017-09-11  9:16   ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2017-09-11  9:16 UTC (permalink / raw)
  To: Thierry Ghelew, zsh-workers

On Sun, 10 Sep 2017 23:09:17 -0400
Thierry Ghelew <tlux@ghelew.net> wrote:
> 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!

Thanks --- zpty has always been a cross-platform disaster area, so I've
simply applied this.

pws


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-11  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170911031011epcas1p366010bccd08586557775765776b7c55b@epcas1p3.samsung.com>
2017-09-11  3:09 ` [PATCH] add the full range of OpenBSD ptys Thierry Ghelew
2017-09-11  9:16   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).