Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!rpi!usc!samsung!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.unix.questions Subject: Re: ASCII question Message-ID: <1991Mar27.224615.21902@Think.COM> Date: 27 Mar 91 22:46:15 GMT References: <1270@caslon.cs.arizona.edu> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 24 In article <1270@caslon.cs.arizona.edu> andrew@cs.arizona.edu (Andrei V. Zaitsev) writes: >I have a question about ASCII code. Can I be sure that character >with code 13 will return cursor to the beginning of the line >independently of the terminal type ? If you're willing to assume that you're talking to an ASCII terminal you should be pretty safe. Then again, any ASCII system that supports non-ASCII terminals probably also has a tty driver that automatically converts from ASCII; however, if your program writes in raw mode this conversion would be bypassed. You're also probably safer using '\r' rather than '\015', since the former will work properly on a system that uses something other than ASCII internally. Some terminals can be configured to perform a line feed automatically after receiving carriage return. However, since most Unix software doesn't expect this, it's safe to assume that the terminal is not in this mode. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar