Picking up on a couple really old threads (e.g. http://osdir.com/ml/ietf.secsh/2001-09/msg00003.html ) I've finally gotten around to this. The EXTPROC support on Linux is missing, but you can find kernel patches for that here http://lkml.org/lkml/2010/6/11/403 I've also fixed up the netkit telnet / telnetd code to work with EXTPROC / LINEMODE on Linux, those patches are here http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585527 These ssh patches are still not even half-baked, just a proof of concept to get feedback and guidance on what the right approach actually is. To get an idea of where it's coming from you should read RFC1184 which gives the Telnet LINEMODE spec. Since the ssh protocol doesn't have the Do/Dont/Will/Wont option negotiation of Telnet things are of course a bit different here. Instead of explicit negotiation, the server assumes the client supports linemode if it includes an EXTPROC bit in its tty modes. I've added a new "tty-changed" channel message as well, for the server to send tty mode changes back to the client. The client will assume the server supports linemode if it sends tty-changed messages. If the server reports that the session tty is in cooked mode (ICANON|ECHO) then the client will use the readline library to process input. This opens the possibility of doing full local editing with command history on the client. (Though I haven't enabled history yet in this patch.) So far this is only working as expected for dumb programs that don't try to manipulate the tty modes. I'm working on some patches to the readline library so that it will leave the tty in cooked mode if it detects that EXTPROC is set on the tty. So a remote bash shell will defer all input processing to the local client. Will also be able to support command completion, if the tty session has VEOL set to <TAB>. Right now the tty mode handling on the client is a mess, it will need to be rationalized somehow to work cleanly with older raw-mode-only servers along with the linemode servers. Feedback and help would be greatly welcomed. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: dif1.txt URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20100614/8abe70cd/attachment.txt>
Howard Chu wrote:> So far this is only working as expected for dumb programs that don't try to > manipulate the tty modes. I'm working on some patches to the readline library > so that it will leave the tty in cooked mode if it detects that EXTPROC is set > on the tty. So a remote bash shell will defer all input processing to the > local client. Will also be able to support command completion, if the tty > session has VEOL set to<TAB>.Simple patch for bash/readline here http://groups.google.com/group/gnu.bash.bug/browse_thread/thread/a34500e79021003b#> Right now the tty mode handling on the client is a mess, it will need to be > rationalized somehow to work cleanly with older raw-mode-only servers along > with the linemode servers. > > Feedback and help would be greatly welcomed.If anyone is interested, you can just follow along on this repo: git://github.com/hyc/OpenSSH-LINEMODE.git Everything should work exactly as before when connecting to an unpatached server. With a patched server and patched shell you'll have local editing plus command history. I'm still working out how to pass-thru the command completion bits. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/
Howard Chu wrote:> the client will use the readline libraryHow about libedit? I guess readline is not so hot in OpenSSH upstream. //Peter
libnoise is simple and tiny... Although not all functionality is there... :) On Thu, Jun 17, 2010 at 11:10 AM, Peter Stuge <peter at stuge.se> wrote:> > Howard Chu wrote: > > the client will use the readline library > > How about libedit? I guess readline is not so hot in OpenSSH > upstream. > > > //Peter > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Sorry, linenoise... On Thu, Jun 17, 2010 at 11:14 AM, Alon Bar-Lev <alon.barlev at gmail.com> wrote:> libnoise is simple and ?tiny... > Although not all functionality is there... :) > > On Thu, Jun 17, 2010 at 11:10 AM, Peter Stuge <peter at stuge.se> wrote: >> >> Howard Chu wrote: >> > the client will use the readline library >> >> How about libedit? I guess readline is not so hot in OpenSSH >> upstream. >> >> >> //Peter >> _______________________________________________ >> openssh-unix-dev mailing list >> openssh-unix-dev at mindrot.org >> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >
On Thu, 17 Jun 2010, Peter Stuge wrote:> Howard Chu wrote: > > the client will use the readline library > > How about libedit? I guess readline is not so hot in OpenSSH > upstream.We already use libedit for sftp command editing and completion and we would be loathe to add a dependency on another library that does something similar. -d