[DGD] Telnet Protocol

Steve Foley zeppo1 at mindspring.com
Fri Nov 21 02:02:43 CET 2003


"Noah Gibbs" <noah_gibbs at yahoo.com> wrote:

>   I'd say not just \r, because that's frequently used
> for weird little animation things like status bars.
> You can print the bar, send a \r, print, send \r, and
> repeat.  So that should do the carriage return without
> the newline.

Mmm.  The BSD telnet server leads me to believe there are some telnet
implementations that expect \r to be treated as a return key stroke.  But
I'm also well aware of how \r and overstrikes have and can be used.

Perhaps I should take the time to figure out what the remote client thinks
is a return key stroke, and just add that to \r\n, \n\r and \r\0.

>   My understanding was that you couldn't just sent
> Unix-style \n line endings to telnet, and that you
> always needed to be careful to double them up to \r\n
> just in case you had to deal with a DOS-style client.

Yes.  But lets say I'm implementing a telnet server for DGD.  Now,
internally, DGD does treat \n as a return key stroke.  So maybe in that
context \n should be treated like a return key stroke.

I mean, when you're in the editor for example, hitting return just adds a \n
to the end of the line, right?

I didn't really include that info in my question, so I'm not 'arguing'
against you, just wondering if the answer changes in that context.

>   I believe the vast majority of text sent across the
> 'net does this.  However, I'm pretty sure some doesn't
> work that way, because PUTTY (my Windows-based telnet
> client) has a specific option for dealing with \n-only
> text.  But in general, doubling the line endings up is
> safer when sending, and accepting either \n or \n\r is
> safer when receiving.  Just \r, though, shouldn't act
> like just \n.

Yeah.  Obviously in sending I'd use \r\n, as it appears to be the most
widely accepted.  This last point makes a good deal of sense.  Treating \r
and \n as the same thing definitely seems inappropriate.

Thanks for the response.

--Steve

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list