Whenever Windows telnet receives a telnet negotiation it will automatically
switch itself to character mode, which effectively kills local echo, with no
means of disabling it remotely.

MTH will automatically detect Windows telnet and set COMM_FLAG_REMOTEECHO to
indicate the server should handle input echoing remotely, which is fairly
simple.

MTH will also set COMM_FLAG_PASSWORD when using the echo_on() and echo_off()
functions to disable localecho.

The following example code is taken from Lola 1.4 and echoes back each
character typed in by the user.


	nRead = read(d->descriptor, bufin, MAX_INPUT_LENGTH);

	if (nRead > 0)
	{
		nCurr = d->intop;

		d->intop += translate_telopts(d, bufin, nRead, d->inbuf + d->intop);

		if (IS_SET(d->comm_flags, COMM_FLAG_REMOTEECHO))
		{
			for (nSkip = nCurr ; nSkip < d->intop ; nSkip++)
			{
				switch (d->inbuf[nSkip])
				{
					case   8:
					case 127:
						d->inbuf[nSkip] = '\b';
						write(d->descriptor, "\b \b", 3);
						break;

					case '\n':
						write(d->descriptor, "\r\n", 2);
						break;

					default:
						if (HAS_BIT(d->comm_flags, COMM_FLAG_PASSWORD))
						{
							write(d->descriptor, "*", 1);
						}
						else
						{
							write(d->descriptor, d->inbuf + nSkip, 1);
						}
						break;
				}
			}
		}
	}