pty behaviour
Marcus Brinkmann <[email protected]> Wed, 03 Mar 2004 01:53:46 +0100
| Newsgroups | gmane.os.hurd.devel.readers |
|---|---|
| Message-ID | <[email protected]> |
Hi, I figured out why screen doesn't support cut&paste of more than 300 characters. This is the high watermark in term. The pty_io_write implementation drops (flushes) all input if the queue is suspended (qavail returns 0). This will be the case when the high watermark is reached. Thus, if screen uses a single write to its pty end when the text is pasted, only up to the first 300 characters are written. pty_io_write does in particular not suspend the write, wait on the queue condition and continue after the queue is drained below the low watermark and unsuspended. I couldn't find a description of what pty's are supposed to do on read/write. However, screen seems to expect to be able to do it, and screen is widely ported. Actually, I tried to find out what screen is trying to do (ie if it splits up the input in chunks etc), but the code is a horrid mess (it's slowpaste option worked, though, IIRC, as it sends input char by char). Likewise I saw a perl pty test fail due to this. So, is there anything I am missing? Shouldn't we implement pty_io_write as any other writer, with suspending behaviour unless O_NONBLOCK is set (if that is even possible for a pty)? Thanks, Marcus