This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: Opinions solicted for changes to tty names in 1.7.10
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-apps at cygwin dot com
- Date: Sat, 2 Jul 2011 19:43:16 -0400
- Subject: Re: Opinions solicted for changes to tty names in 1.7.10
- References: <20110614203637.GA1128@ednor.casa.cgf.cx> <BANLkTik3EruHmoMaDxSNBgeb_YykuhufoQ@mail.gmail.com> <20110615145557.GA19070@ednor.casa.cgf.cx> <BANLkTikGfBP2iWLhwd=TB6-rwko=4CHpyw@mail.gmail.com> <20110615205257.GF23078@ednor.casa.cgf.cx> <CAHWeT-avXorm9B=uNAdBCnkMzrx00R_4FdvDdOaNUOkGKMGR_A@mail.gmail.com>
- Reply-to: cygwin-apps at cygwin dot com
On Sat, Jul 02, 2011 at 06:42:04AM +0100, Andy Koppe wrote:
>On 15 June 2011 21:52, Christopher Faylor wrote:
>> On Wed, Jun 15, 2011 at 09:46:24PM +0100, Andy Koppe wrote:
>>>On 15 June 2011 15:55, Christopher Faylor wrote:
>>>> On Wed, Jun 15, 2011 at 01:28:55PM +0100, Andy Koppe wrote:
>>>>>On 14 June 2011 21:36, Christopher Faylor wrote:
>>>>>> After some discussion with Corinna, I'm thinking about making a change to
>>>>>> the tty naming in Cygwin as part of the removal of CYGWIN=tty.
>>>>>>
>>>>>> (In case you haven't noticed, CYGWIN=tty, is no longer supported in
>>>>>> snapshots. ??If you do have the tty option set you get one warning per
>>>>>> session telling you to unset it.)
>>>>>>
>>>>>> Since the only thing using Cygwin's "tty layer" will now be ptys, I'd
>>>>>> like to rename /dev/ttyN to /dev/ptyN. ??I've already added /dev/consN
>>>>>> support for consoles but I'd like to change that so that consoles are
>>>>>> represented as /dev/ttyN instead.
>>>>>
>>>>>Makes plenty of sense.
>>>>>
>>>>>The only concern I see is that BSD PTYs (as previously used on Linux
>>>>>as well, IIRC) are called "pty[p-za-e][0-9a-f]" on the master side,
>>>>>whereas they're "tty[p-za-e][0-9a-f]" on the slave side. Therefore
>>>>>calling the slave side "ptyN" could conceivably cause issues.
>>>>>
>>>>>Is the Unix98 scheme ("/dev/pts/N") that's used on Linux these days
>>>>>out of the question?
>>>>
>>>> No. ??I considered that but adding an arbitrary directory structure under
>>>> out /dev kludge seemed wrong. ??I would prefer to make it look more like
>>>> Linux though. ??The man reason why I didn't implement that is that I
>>>> thought someone would report that "ls /dev/pts" doesn't work
>>>
>>>Good point. Unlike "ls /dev/pty*", it would actually be useful as it's
>>>supposed to contain the currently used ptys.
>>>
>>>> not that it couldn't be made to work.
>>>
>>>That would be nice.
>>
>> I agree. ??So, I guess I'll look into what it would take to implement
>> that and hold off the renaming for now.
>>
>>>The terminal is supposed to cut off all of "/dev/tty", especially as
>>>Cygwin's ut_id is only 2 chars, whereas Linux's is 4.
>>
>> Oh right. ??I knew that.
>
>Hmm, the two-character ut_id would actually be a problem with Unix98
>ptys, because according to Linux's 'man utmp' it's supposed to be 'p'
>followed by the pts number there. This would only allow for 10 ptys.
>
>How about going with the BSD scheme as previously used on Linux?
>Should be much less work than Unix98 ptys as well.
>
>consoles: ttyN
>pty masters: /dev/pty[p-za-e][0-9a-f]
>pty slaves: /dev/tty[p-za-e][0-9a-f]
>
>The [p-za-e][0-9a-f] encoding allows for up to 256 pseudo terminal
>pairs and fits into ut_id.
If it boils down to making the tty number look more like linux
(/dev/pts/10) or just puting a "10" in ut_id, I'd opt for just putting
the "10" there. The "p" really wouldn't make any sense for Cygwin since
we no longer have ttys.
cgf