viewing text files containing Windows line breaks with vi on a UNIX system I
would expect, that Windows line breaks are displayed as ^M.
But Putty doesn't display ^M for Windows line breaks on my PC.
How has Putty to be configured, that Windows line breaks are displayed as ^M
in Putty?
Thomas Wiedmann
Text files have three different types of line boundaries:
Windows carriage return + line feed
Mac carriage return
Unix new line (same character as line feed)
When vi (perhaps you are really using vim?) shows ^M, that's not the entire
line boundary, just the carriage return character in the line boundary.
Are you checking for improper ascii file translation? Then just do a global
elimination of ^M in vi, which fixes the line boundary.
There are certainly text editors that will make line boundaries visible.
Don't know of one for Unix off the top of my head, and you're asking in
the wrong newsgroup. Ask in comp.editors.
This should not be a feature of the terminal emulation itself.
It is vi that translates the carriage-return character into the two
characters caret and M.
If you use a LAN sniffer you'll see that vi transmits two characters
caret M not a single carriage-return character.
> But Putty doesn't display ^M for Windows line breaks on my PC.
>
> How has Putty to be configured, that Windows line breaks are displayed
> as ^M in Putty?
It isn't a job for Putty. Here's some Putty output cut & pasted on my
Windows PC:
$ cat test.txt
aaa
bbb
ccc
$ cat -v test.txt
aaa^M
bbb^M
ccc
What characters get sent to Putty depends both on the Unix/Linux program
being used (e.g. vi) and also on the stty settings. look at `man stty`
and the entries for ocrnl onlcr etc.
As far as I know, there's nothing in any ANSI, Xterm or VTxxx
specification to say that a terminal should normally display a caret and
an M when it receives a carriage-return character.
--
RGB
Hasn't Mac switched to the Unix convention now that the Max OS is just
a candy-colored shell on top of Unix?
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
I'm not working with a Mac.
Thomas Wiedmann
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
>>Text files have three different types of line boundaries:
>>Windows carriage return + line feed
>>Mac carriage return
>>Unix new line (same character as line feed)
>Hasn't Mac switched to the Unix convention now that the Max OS is just
>a candy-colored shell on top of Unix?
I didn't know that, not being a Mac user.
The carriage return line boundary applies through OS 9 only.