<p>I have an application where I accept a socket connection from a telnet client and put up a simple, keyboard driven character GUI.</p>

<p>The telnet client, at least on Linux, defaults into line-at-a-time mode, so I always have to do <code>^]mode char</code> manually.</p>

<p>A skim of the relevant RFCs suggests that if my application simply sent the characters <code>IAC DONT LINEMODE (\377\376\042)</code> as soon as the client connects, the client should be forced into character mode.  However, it doesn't make any difference.</p>

<p>What's the simplest bit of code that would do the job?  Ideally just a string to be sent. My application can absorb whatever junk the client sends back.</p>

For what it's worth, solved it myself.
```
```
// IAC WONT LINEMODE IAC WILL ECHO

write(s,"\377\375\042\377\373\001",6);
```
```
gets the remote (at least telnet from an Xterm on a Linux box) into the right state.