src/vs/workbench/services/preferences/common/preferencesModels.ts/escapeInvisibleChars
function escapeInvisibleChars(enumValue: string): string {
	return enumValue && enumValue
		.replace(/\n/g, '\\n')
		.replace(/\r/g, '\\r');
}