bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ncurses on pipes


From: Avery Pennarun
Subject: Re: ncurses on pipes
Date: Wed, 13 Jun 2007 13:51:24 -0400

On 13/06/07, Robert Lemmen <address@hidden> wrote:
but it has the same problem as a telnetd:
the number of ptys. as far as i know i can only create a few (128?)
ptys...

Modern systems don't have the hardcoded pty limits that old ones used
to.  On Linux, check out /proc/sys/kernel/pty/{nr,max}.

ptys give you useful things like raw vs. cooked mode, terminal size
(width x height), baud rates, CTRL-S/CTRL-Q to control scrolling,
backspace key handling, and basically all the other stuff that makes
the difference between a text-based "UI" and a text-based "protocol."

ncurses will rely on having a pty for at least some of that stuff
(especially the terminal size stuff).  I'm sure you could make ncurses
work without it, but then you're stuck simulating the telnet protocol
yourself (including terminal size changes) and rewriting bits of
ncurses to do the same thing the kernel pty layer does.  And you're
unlikely to do it as efficiently in userspace as the kernel people
have already done it.

So I wouldn't worry about ptys.

How many incoming sessions are you planning to host at once, anyway?
Ten years ago, people were hosting 1000 or more IRC clients via telnet
on a single machine, all running in separate processes.  Nowadays that
should be very easy.  It's easy to forget how much more vastly
lightweight terminal programs are than modern GUI programs. A few
thousand mostly-idle telnetd processes and ptys are the least of your
worries.

Have fun,

Avery




reply via email to

[Prev in Thread] Current Thread [Next in Thread]