Bug #66644 Copy from SQL-editor + paste into Windows programs removes linebreaks from code
Submitted: 1 Sep 2012 15:51 Modified: 31 Jan 2018 9:38
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.42 OS:Any
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D4 (Minor)

[1 Sep 2012 15:51] Peter Laursen
See synopsis and 'how to repeat' below.

How to repeat:
type in editor

select 1 
+ 2;

Select everything, copy and paste into Notepad.  It becomes 

select 1 + 2;

I also note that if I paste into a web from (like here) the linebreak is preserved.

Suggested fix:
I think Unix linebreaks are used in editor?  "\n" and not Windows' "\r\n" ? 

This is incompatible with Windows.  The Windows version should use "\r\n" for linebreaks.

(and what about Mac btw? As far as I know Mac uses "\r" for linebreaks)
[1 Sep 2012 17:13] Peter Laursen
I think I reported same with one of the old GUI tools (Administrator, Query Browser) several years ago. It lead to a discussion about what editor to use. 

I am not posting this report to be advised what editor to use.  I am posting a bug report.  So pleae do not repeat this discussion this time. I know perfectly well that there are editors for Windows available that handle \n -linebreaks.  But the *platform* requires \r\n -linebreaks.
[2 Sep 2012 2:22] Miguel Solorzano
Thank you for the bug report.
[4 Nov 2012 2:40] Alfredo Kojima
bug #67061 is a duplicate
[26 Jul 2015 7:24] Paul Weiss
Still the case copying into Notepad from on Microsoft Windows 7 Home Premium SP 1, 64-bit. (Pastes properly into Word 2013 and Notepad++ v6.7.9.2.)
[31 Jan 2018 9:38] Mike Lischke
Posted by developer:
This works as intended. Workbench uses \n linebreaks everywhere. Almost every editor (also on Windows) can deal with that.