现在的位置: 首页 > 综合 > 正文

WinSCP如何在进行远程编辑和保存的时候保留原有的换行符格式不变?Preserve line ending (LF vs. CR/LF) when editing

2013年10月28日 ⁄ 综合 ⁄ 共 792字 ⁄ 字号 评论关闭

Issue/Problem:

I'm not sure how this bug hasn't been observed yet:

When the user saves a file they are editing in WinSCP, the line ending type is forced to CR/LF. Since the vast majority of files on Linux systems use LF only, this leads to all sorts of errors.

WinSCP should either detect and preserve the line ending type (best option), or (easy) force it to line feed only, which is supported on Windows by most applications, except toy ones like Notepad.

 

Solution:

The key is to un-tick an option in the Editors tab that reads
'Force text file mode for files edited in external editor' which can be found when you click 'Edit' on your external text editor.

 

Other key configuration sections:

WinSCP Login -> Environment -> "End-of-line characters (if not indicated by server)" and the setting was "LF" or "CR/LF" 

 

if want WinSCP to transfer file as is, please make sure you are using
binary transfer mode
:
http://winscp.net/eng/docs/transfer_mode

抱歉!评论已关闭.