NetBSD-Users archive

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

Re: cannot disable output processing in pseudo-terminal (between openpty(3) parent and child)



Valery Ushakov writes:
> FWIW, I have a simple program I've been using to debug kernel vt100
> emulator, and:
>
> $ ./wsemul -- printf '\n'
> $ hexdump -C wsemul.raw 
> 00000000  0d 0a                                             |..|
> 00000002
> $ ./wsemul -- sh -c 'stty raw; printf "\n";'
> $ hexdump -C wsemul.raw 
> 00000000  0a                                                |.|
> 00000001
>
> where wsemul.raw is the (unfortunately named) dump of everything
> received from the slave on the master side.
>
> The program doesn't do anything fancy with the pty.
>
> https://hg.sr.ht/~nbuwe/wsemul/browse/run.c?rev=tip

Thanks for sharing this.  I was using the BSD-style openpty(3) call
before but now replicated your use of POSIX posix_openpt(3) etc.
It made no difference.  In both cases running stty(1) with operands
"raw" or "-opost" are ineffective and OPOST remains set after
running them.

One difference I see with your code is that you don't seem to change
the controlling terminal in the child with setsid(2) and a TIOCSCTTY
ioctl(2).

I'm still puzzled as to why I can't disable OPOST programmatically
or using stty.

FWIW I have set TERM=dumb in my terminal and that also seems to
affect input and output processing.

Pouya


Home | Main Index | Thread Index | Old Index