normalize line endings to \r

fixes #683
This commit is contained in:
Jeremy Danyow
2017-06-14 14:51:36 -07:00
parent 9cc878cea7
commit ce61795c38
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -9,6 +9,6 @@ describe('evaluatePastedTextProcessing', function () {
windowsProcessedText = Clipboard.prepareTextForTerminal(pastedText, true);
assert.equal(processedText, 'foo\r\nbar\r\n');
assert.equal(windowsProcessedText, 'foo\nbar\n');
assert.equal(windowsProcessedText, 'foo\rbar\r');
});
});
+1 -1
View File
@@ -22,7 +22,7 @@ declare var window: IWindow;
*/
export function prepareTextForTerminal(text: string, isMSWindows: boolean): string {
if (isMSWindows) {
return text.replace(/\r?\n/g, '\n');
return text.replace(/\r?\n/g, '\r');
}
return text;
}