Bug 501303

Summary: Strip out newlines and other control/special characters when pasting a filename from clipboard
Product: [Applications] dolphin Reporter: Mohammed Khoory <the.9a3eedi>
Component: panels: foldersAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: fanzhuyifan, kfm-devel
Priority: NOR    
Version First Reported In: 24.12.2   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Mohammed Khoory 2025-03-10 15:26:40 UTC
SUMMARY
If you paste the text contents of the clipboard into dolphin when renaming a file, and the text contents contain newlines (and possibly other uncommon characters), Dolphin currently leaves those characters in. This is not a bug, but it is also most likely not the intended behaviour of the user, and tends to cause problems for the user further down the line. I would like to propose to have Dolphin remove those characters automatically after pasting. 

Discussion here:
https://discuss.kde.org/t/remove-newlines-when-pasting-a-filename-from-clipboard-in-dolphin-while-renaming-a-file/31017?u=9man

STEPS TO REPRODUCE
1. Copy a string of text that contains newlines
2. In dolphin, select a file, right click and rename
3. Paste the string of text

OBSERVED RESULT
The new filename contains newlines.

EXPECTED RESULT
The new filename should contain the string without newlines or other control characters

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 6.6.80-1-MANJARO 
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Comment 1 fanzhuyifan 2025-03-11 04:41:16 UTC

*** This bug has been marked as a duplicate of bug 444747 ***