SUMMARY Creating a new text file creates a new file with 2 bytes of data. This is annoying as opening the file in KWrite afterwards means you need to delete these additional characters to have an empty file with no additional new lines or white space characters. STEPS TO REPRODUCE 1. In a directory, open the context menu and select Create New > Text File 2. Select OK OBSERVED RESULT A new text file is created already containing data. EXPECTED RESULT A new empty file is created with the name provided by the user. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.113.0 Qt Version: 5.15.11 Kernel Version: 6.6.8-arch1-1 (64-bit) Graphics Platform: Wayland
Can reproduce on Plasma 6 as well.
This appears to be intentional, so that the created file is detected as a text file MIME type and not as an empty file. There is a separate option to create a truly empty file (0 bytes) if this is what is required. See the duplicate bug. *** This bug has been marked as a duplicate of bug 297003 ***
(In reply to Jonathan Marten from comment #2) > This appears to be intentional, so that the created file is detected as a > text file MIME type and not as an empty file. There is a separate option to > create a truly empty file (0 bytes) if this is what is required. See the > duplicate bug. > > *** This bug has been marked as a duplicate of bug 297003 *** As a user, I would expect that "Create new text file" would just create an empty file with the ".txt" extension. Having a white space character included on the first line is a bit annoying. It seems like KWrite automatically strips this character when you save the file, but if you were to open the file in Vim it would not be stripped automatically. At most, I think maybe a newline character would make sense so that you automatically have the file ending in a newline character when you type something in on the first line directly after file creation, but that's all.