BigSur: open command not handling file URI scheme properly

In BigSur Beta, when I try to open a file using
Code Block bash
open file:////Users/<username>/Desktop/<filename.txt>

the command is internally converted by prefixing the current working directory in terminal to the given value. For eg., if the current directory is "/Users", the command is converted into
Code Block bash
open /Users/file:////Users/<username>/Desktop/<filename.txt>

This obviously gives an error unable to find the file. This happens even if I give a folder name instead of filename in file URI format.

http scheme works fine and no prepending happens. For eg., open http://<url> redirects to safari cleanly


Note: I understand from the man page, that whenever we give a non-absolute file/folder names to open command, it prepends the current directory to the given value. However this prepending should not happen in case the value starts with a file URI scheme (similar to how values starting with http is handled).

This is working fine till Catalina and is present only in BigSur betas. Can someone confirm this behaviour.
Post not yet marked as solved Up vote post of svprakash001 Down vote post of svprakash001
2.4k views

Replies

Can someone confirm this behaviour.

Nope. It works fine here.


Thanks @Etresoft. Can you pls confirm your Beta version and Build number. Mine is 20A5384c

Can you pls confirm your Beta version and Build number. Mine is 20A5384c

This is not related to beta versions or builds.


It looks like the bug is still present in some form, as since I updated to BigSur I am unable to open message:// URLs using the open command. This is explained in details in this StackOverflow question, but in brief, the following command would have worked in Catalina (by opening a specific email in Mail.app)

open -a "Mail.app" "message://<CALoR5A+vANPG9eCcHRHnO@mail.gmail.com>"

while in BigSur it leads to the following error:

The file /Users/macbook/message:/<CALoR5A+vANPG9eCcHRHnO@mail.gmail.com> does not exist.
In macOS 11.2.1

A very similar issue with the Office URI Schemes..
Code Block
$ open "ms-word:ofe|u|https://<hostname>/dave/24e3ee9b7743978301775c776cb50566/10040WordDocument.docx"
The file /Users/tanmay/ms-word:ofe|u|https:/<hostname>/1/dave/24e3ee9b7743978301775c776cb50566/10040WordDocument.docx does not exist.

It works fine in macOS 10.15.7. Is this a bug?? This is mission critical bug for people relying on Office URI schemes, unless there is other way arround.
Hello,

Same problem here with the URL starting with file://

I am on Big Sur version 11.2.3.

Yes, is it a bug?

Hi,

Similar problem when URL contain non-English characters.

The below command works fine in 10.15 (The wikipedia page for "Japan"):

$ open https://ja.wikipedia.org/wiki/日本

which show error in Big Sur like:

$ open https://ja.wikipedia.org/wiki/日本
The file /Users/myMac/https:/ja.wikipedia.org/wiki/日本 does not exist.

I have to encode the URL in Big Sur:

$ open https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC

I think the escaping part of open command in Big Sur has bug.

Please check about it.

  • In the just released macOS Big Sur 11.6, the open command is still defective – e.g. the above command still yields the same error.

Add a Comment

Same for encoding spaces within anything in quotes.

This used to work and is not working anymore:

$ open -a /Applications/Google\ Chrome.app "https://www.google.com/search?q=test search"
$ The file /Users/***/https:/www.google.com/search?q=test search does not exist.

How so?