Re: [ Problem ] Hmm How to send new prompt to char...

From: Erwin S. Andreasen (erwin@PIP.DKNET.DK)
Date: 08/29/97


On Fri, 29 Aug 1997, Gary Barnett wrote:

> David Klasinc <bigwhale@CAPYBARA.SK-PTTSC.LJ.EDUS.SI> wrote:
>
> <snip>
>
> >       send_to_char("\n\r", ch);
> >
>
> Ack! Don't do the \n\r thing.
>
> It's my belief (am I wrong?) that \r\n is correct, and \n\r really
> frustrates those who would write a mud client.

\r\n should be correct - according to some telnet RFC/standard (which?
grep -i telnet rfc-index | wc -l shows no less than 91 mentions of telnet
:0 ).

All MERC derivatives, however, use \n\r. Personally, I use just \n
everywhere and expand it to \n\r in the function that writes all data to
descriptors. Having to type 4 characters where 2 would suffice is IMHO a
pain, and if you expand color codes and such anyway...

I tried switching to \r\n once BTW, but that actually *broke* one client -
tush.

Raw telnet has no problems with \n\r, nor have I heard any complains from
people about getting double lines this way.

In my own MUD client, mcl (see my homepage! :), I just discard all those
\rs, and change to a new line when encountering an \n.

 =============================================================================
Erwin Andreasen   Herlev, Denmark <erwin@pip.dknet.dk>  UNIX System Programmer
<URL:http://pip.dknet.dk/~erwin/>         <*>           (not speaking for) DDE
 =============================================================================


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST