Closed
Bug 1502719
Opened 6 years ago
Closed 6 years ago
tilde ~ should expand to the user's home directory
Categories
(Core :: Networking: File, defect)
Tracking
()
People
(Reporter: Christian.Hujer, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/70.0.3538.67 Chrome/70.0.3538.67 Safari/537.36
Steps to reproduce:
I run Firefox on the Linux operating system. The expectation on Unix systems is that some path expansion is supported, in particular, the ~ character is expected to expand to the home directory of the current user. So I entered ~/playground in the address bar.
Actual results:
Firefox started a Google-search with ~/playground as the search text.
Expected results:
Firefox should have opened the directory `/home/christian.hujer/playground`.
Note: I believe this is a regression. If I remember correctly, tilde expansion in Firefox worked just fine a few years ago.
Comment 1•6 years ago
|
||
No - local URLs start with file:///. For explanding ~, see bug 93141.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Component: Untriaged → Networking: File
Product: Firefox → Core
Reporter | ||
Comment 2•6 years ago
|
||
@Andre Klapper
We don't always enter URLs in the address bar. For example, "www.google.com" also is not a URL either, or is it? Or "foo bar", that is definitely not a URL. Whether ~ is a local URL or not doesn't matter, it doesn't even matter whether it's a URL at all. Of course, in the end, the browser has to have a URL. But handling non-URLs in the address bar already happens. What if a user enters "foo bar". Then it starts the Google search, which in that case is perfectly fine. So why not simply have one more case that handles the regex /^~(.*)/. It's about user convenience. Chromium can do it. Netscape Navigator and SeaMonkey did it in the past, and if I remember correctly, even Firefox did that in the past, so it's actually a regression. And that it doesn't start with file:// is not a good reason at all to not implement this. Actually, the effort of typing this comment is probably already more effort than the implementation. So, maybe I'll submit a pull request.
Reporter | ||
Comment 3•6 years ago
|
||
@Andre Klapper Also, I'm not sure whether this is a duplicate of 93141. In its title, 93141 talks of file://. This one talks of ~ explicitely. In the UI these are different things. While the discussion of 93141 mentions ~, this is not implemented despite that 93141 is 18 years old. The browsers Chrome, Chromium, and Konqueror understand ~ and take the user to their home directory. They automatically expand ~ at the start of th e address bar to file://$HOME with $HOME being environment variable that points to the home directory of the user, for example /home/christian.hujer which means in this case ~ expands to file:///home/christian.hujer and then file:///home/christian.hujer/ after the browser has identified that the path is a directory.
You need to log in
before you can comment on or make changes to this bug.
Description
•