Hans Lub wrote:
This is not about a bug, but a feature request:
Apparently the majority of the free software world uses high speed low latency networks and doesn't care about this issue. Certainly few people have contacted me with any interest in pursuing this further. I generated patches for readline, libedit, and OpenSSH but neither their maintainers nor any other users cared and the patches are probably bitrotted by now. I never anticipated that getting traction in the kernel was going to be the easiest part of this effort...
Suppose I ssh into a server on Mars. Whenever I press a key, I will first see the echoed keystroke some 20 minutes later. Very unnerving! Luckily, the sshd on Mars can put its pty in EXTPROC mode. Input line editing (with backspace) and character echo are disabled by the tty driver, and will now be done on Earth by the ssh client. (this is known as LINEMODE, c.f. RFC 1116) The Martian client (say a shell) doesn't have to know about this, but whenever it turns e.g. ECHO off this will now actually change the behaviour of the Earthly client. To do this, this client must of course know about the state (termios structure) of the Martian pty. To make this possible, EXTPROC uses packet mode, and a special packet (having a control byte with TIOCPKT_IOCTL set) will communicate pty state changes (say by sending the new termios structure to Earth) Now we're at it, we might as well build readline into the ssh client so that line editing becomes really comfortable. But here is a snag: if the Martian shell uses readline itself, it will keep its terminal in non-canonical mode all the time, so that we on Earth never get to know that Mars is expecting entire lines from us. Howard Chu, who submitted a patch to put EXTPROC in the linux tty driver this summer, suggested that readline sense EXTPROC and would behave like "gets with a prompt" in that case, keeping the terminal in canonical mode, so that Earthlings can use the readline on their side. He even submitted a (quick and dirty) patch for readline but I cannot find any response to his submission. The upcoming version of the readline wrapper rlwrap will also be able to use EXTPROC, as it solves the long standing race condition where rlwrapped command may change its terminal state and rlwrap will only learn about that *after* the next keypress. Using EXTPROC, rlwrap will be notified immediately by a packet with TIOCPKT_IOCTL. If readline were "EXTPROC-aware" then one could transparently rlwrap commands that use readline and have rlwrap do the line editing. This can be useful when e.g. the command doesn't save its command history, or if we prefer a coloured prompt. I am not quite sure how widespread EXTPROC is. It used to be in BSD, but was retired from FreeBSD in 2004, when they apparently lost all faith in interplanetary travel. Linux never knew about it until summer 2010, when the spread of mobile internet made people sometimes wonder whether the whole internet had suddenly relocated to Mars. My question (after this long and winding story): wouldn't it be a good idea to make readline EXTPROC-aware?
-- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/ _______________________________________________ Bug-readline mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-readline
