| Summary: | Unable to create new folder named "~" without using escape character | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Giorgi Gzirishvili <drn+dev.report.bugs.kde> |
| Component: | general | Assignee: | David Faure <faure> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | bugseforuns, drn+dev.report.bugs.kde, elvis.angelaccio, kdelibs-bugs-null, nate |
| Priority: | NOR | Keywords: | usability |
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Manjaro | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/frameworks/kio/commit/610435c11ff7d1d8cba415995bcb2810e87209a2 | Version Fixed/Implemented In: | 5.71.0 |
| Sentry Crash Report: | |||
|
Description
Giorgi Gzirishvili
2017-03-23 15:28:50 UTC
This is consistent with POSIX behavior. In a bash shell, doing "mkdir ~" within a directory also says "mkdir: cannot create directory ‘/home/user’: File exists", while "mkdir \~" works. ~ in Unix is your home folder (and ~user is /home/user), so we probably should not silently allow creating directory names that start with a tilde character, but warn instead. I know, I know... My point is if you're typing a name in a field, it should assume quotation marks around it; otherwise, it'd be necessary to escape spaces and other special characters too. So, try 'mkdir "~"' instead, it works flawlessly. Moreover, even if it's an intentional feature, it should at least display an error message and it just does nothing instead. Also, it's GUI, so it should be easy to use even for noobs. The current behaviour is undoubtedly inconsistent. You can create a folder named "'", " ", or "\" without escaping the characters and when you do escape them, it results in the name containing the escape character too, like "\'", "\ ", or "\\". This contrasts with what happens in the case of "~" as a name. Also an unintentional behaviour similar to this one: When you're trying to create a folder named "." or "..". Dolphin displays a warning saying "The name "." starts with a dot, so the directory will be hidden by default.", but after you click "Create directory" button and it fails to do so (obviously, you can't create these two under a *nix system), it doesn't even display an error message. I'm not sure if I should file another bug report regarding this. Yeah, this isn't very user-friendly. We don't require escape sequences for spaces and ampersands and the like; tildes should be the same way. Giorgi Gzirishvili, please do file another bug to track that. If we have multiple issues tracked in one bug, when the bug gets closed after one of them is fixed, the other issues are lost. Nate Graham, Done. https://bugs.kde.org/show_bug.cgi?id=387449 Regarding this bug, I think it'd be better if Dolphin displayed a warning that creating a folder named "~" isn't recommended since if the user accidentally does "rm -r ~" (without escaping ~) from the shell, it'll remove the user's home folder instead. Git commit 610435c11ff7d1d8cba415995bcb2810e87209a2 by Ahmad Samir. Committed on 28/05/2020 at 09:24. Pushed by dfaure into branch 'master'. [KnewFileMenu] Allow creating a dir named '~' It is a weird name for a dir, but it's better to allow such an operation rather than fail silently. FIXED-IN: 5.71.0 M +9 -8 src/filewidgets/knewfilemenu.cpp https://invent.kde.org/frameworks/kio/commit/610435c11ff7d1d8cba415995bcb2810e87209a2 |