Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with Windows new line characters being introduced into text files on Eclipse SFTP synchronization (via JCraft's SFTP plugin).

I've set "New text file line delimiter" to Unix and have even sanitized the file with "fromdos" but every time I upload using the SFTP plugin, Windows new line characters can be seen in the remote file as "^M" characters (when viewed in vi).

A point to note is that if I upload using an external SFTP client, it's all fine.

Eclipse Version: PDT (Helios)
SFTP: jcraft sftp plugin
Local Environment: Ubuntu 10.04
Remote Environments: FreeBSD 6.4, Debian 4.0

What am I missing?

share|improve this question

This is a behavior of the JCraft plugin. You should probably contact JCraft support about it, but you might try adding the line.separator property to your <eclipse_dir>\configuration\config.ini and setting it to LF.

share|improve this answer
Thanks for your response. Adding that extra line in config.ini didn't seem to work. I'll need to investigate more... maybe it's not the jcraft after all... I'll keep you posted – denormalizer Jan 18 '11 at 23:54
up vote 0 down vote accepted

The only workaround I’ve found (which is usable but not entirely satisfactory) is if I add the following:

/Preferences/Team/File Content/
 * Name/Extension: *.php
 * Content: Binary
share|improve this answer
The side effect of this hack is a missing line feed at EOF resulting in the following error if viewed in vim: [Incomplete last line] – denormalizer Jun 17 '11 at 2:17
This issue has now been confirmed with the author of the eclipse sftp plugin. ymnk: "If we have an opportunity to enhance that plug-in, that functionality may be hacked." – denormalizer Jun 22 '11 at 1:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .