When creating a directory with the F7 Mkdir button, tildes are treated as literal strings, rather than being expanded to a user's home directory. ~/additional/paths and ~user/additional/paths should work as expected: i.e., they should be expanded to the correct home directory. This expansion works for copy and move, which makes mkdir even more surprising. It is possible that this is really a KIO bug. From briefly looking at the krusader source, it looks like it goes: ListPanelFunc::mkdir files->mkDir whence maybe: DefaultFileSystem::mkDir KIO::mkpath I am not familiar with either the krusader or kio source, however, so this may not be correct. All I'm certain of is that it doesn't work properly as an end user. STEPS TO REPRODUCE 1. Open krusader, navigate to a writable directory other than $HOME. 2. Hit F7 or press the Mkdir button on the FN bar 3. Enter, e.g., ~/foo OBSERVED RESULT The directory ~ is created in the current directory, with foo beneath it. EXPECTED RESULT The directory foo should be created in the user's home directory. SOFTWARE/OS VERSIONS Linux: 6.3.6 KDE Plasma Version: NA KDE Frameworks Version: 5.102.0 Qt Version: 5.15.8 ADDITIONAL INFORMATION
Interesting, didn't even know that Mkdir could do more than just creating a directory in the current directory, but `test/test` works creating a nested directory, and even `../test` works creating a directory outside the current one. Even absolute paths work like `/home/username/test` , therefore I'd conclude that the user is right to expect tilde expansion to also work, but I can confirm in the following environment that it doesn't: Operating System: Kubuntu 23.10 KDE Plasma Version: 5.27.8 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 It's still not necessarily a bug as tilde expansion is a feature which is definitely not universally supported, therefore I believe that importance should be set to wishlist.
The bug priority is probably a matter of project standards, with which I am not familiar. Similar bugs, open and closed, on bugs.kde.org seem to all be "normal". I do not believe there is any governing standard for *nix GUIs here, nor have I done an exhaustive survey, but I did check a few different toolkits and programs, and everything from Tk to JavaFX seems to support tilde expansion where it is applicable. This accords with my own expectation, which is that it should work in (almost) any interactive context. This is a bit of a nuisance to implement, as it is a platform convention without platform support, but Qt, kdelibs, and krusader manage it well (mostly!). Unfortunately, I have not had the time to investigate whether my hypothesis about KIO in the original report is correct; I was hoping someone more familiar with the source and libraries (I haven't really done any KDE development since 3.x) would take a look.
I'm considering this to be a feature request. Tilde expansion is a feature of the shell and the current behavior of KIO::mkpath() and KIO::mkdir() of creating a directory named "~" is not exactly wrong. Note that Dolphin does the tilde expansion because it is implemented in KIOs KNewFileMenu (see https://invent.kde.org/frameworks/kio/-/blob/master/src/filewidgets/knewfilemenu.cpp#L1265 ).