From 83dce91c4756547b6166900aa8845dbbdf9b21b6 Mon Sep 17 00:00:00 2001 From: Tedward747 Date: Sun, 20 Mar 2022 21:27:57 -0600 Subject: [PATCH] Strip LRM and RLM in Linux names (fix #1361, PR #1365) On Linux (SUSE at least), if `--name` isn't provided and is inferred, the filename is prepended with the control character LRM (https://en.wikipedia.org/wiki/Left-to-right_mark) and I'd assume RLM for anyone who's using that setting. This PR strips those control characters out of the file name. --- src/utils/sanitizeFilename.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/sanitizeFilename.ts b/src/utils/sanitizeFilename.ts index d52e81f..d784fe6 100644 --- a/src/utils/sanitizeFilename.ts +++ b/src/utils/sanitizeFilename.ts @@ -11,7 +11,7 @@ export function sanitizeFilename( // spaces will cause problems with Ubuntu when pinned to the dock if (platform === 'linux') { - result = result.replace(/\s/g, ''); + result = result.replace(/[\s\u200e\u200f]/g, ''); } if (!result || result === '') {