Ubuntu QA:
BlogBrainstormPackage status
Log in
Ubuntu QA
The Ubuntu community has contributed 21549 ideas, 132424 comments, 2606791 votes
Idea sandbox Idea sandbox
Popular ideas Popular ideas
Ideas in development Ideas in development
Implemented ideas Implemented ideas
Idea #25739: /bin/open should open a file with the system default application

Written by albertz the 31 Aug 10 at 17:35. Category: System. Related project: Nothing/Others. Status: New
Rationale
You have the same on MacOSX: There is an "open" command you can use in your shell and it will open a file with the system default application.

On Linux/Unix, it is quite similar to what xdg-open does.

For people who don't know about xdg-open and/or who are familiar with MacOSX and/or who want the shell to behave more natural, it would be nice to have the command "open" just behave this way.

35
votes
up equal down
Solution #1: open should be an alias to xdg-open
Written by albertz the 31 Aug 10 at 17:35.
Currently, open is a symlink to openvt which executes a command on another virtual terminal. I think, this is a bad idea because it is not very natural. This symlink should be changed instead to xdg-open.

I have filled in a bug report about it:
https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/619913
4
votes
up equal down
Solution #2: Remove /bin/open and create /usr/bin/open -> /usr/bin/xdg-open
Written by mikaelstaldal the 1 Sep 10 at 09:34.
Remove /bin/open, and create /usr/bin/open to link to /usr/bin/xdg-open.
2
votes
up equal down
Solution #3: Suggest to use xdg-open on X and other command on console.
Written by Lachu the 9 Sep 10 at 16:54.
Shell should suggest to use proper command for opening file in current environment.

Take a look at fish and ZSH(+Open extension). People are typing only file name and shell do rest of work.

Bash/Sh should behaves similar, but show message on interactive session(on default error output) instead do open.

Message should be different on different environment. On X we should suggest to use graphical tool, but on console we should suggest to use console tools.

To detect X are setup, we can check DISPLAY, X_IS_UP environment variables.

Example:
nice_image.png are not executable. Use xdg_open nice_image.png to view/open it.

Second example:
nice_image.png are not executable. Use con_open nice_image to view/open it.

I think CNF script could be point you can start.
1
votes
up equal down
Solution #4: New edit tool
Written by Lachu the 9 Sep 10 at 17:02.
Edit command on DOS are opening file for editing. Linux users are often create alias to text editors.

I think, that Ubuntu should provide edit command, which test file type and suggest tools to open/edit a file.

>edit nice_image.jpg
Choose the best editor:
1. Gimp (Only on X)
2. Gwenview (Only on X)
3. Framebuffer Viewer

>edit /etc/fstab
Choose the best editor:
1. Kate (Only on X)
2. Gedit (Only on X)
3. Vim
4. Pico

Once user select tool, we should show message:
type 'command filename' next time.
-1
votes
up equal down
Solution #5: For a transitional period, don't have anything called "open"
Written by isoma the 15 Sep 10 at 21:01.
Some people & packages might expect to call "open" and get "openvt". New users might expect to get "xdg-open".

I believe that "open" == "openvt" should be deprecated.

For one release or more (perhaps bearing LTS in mind), I propose that Ubuntu not have any "open" command in the path. To put icing on the cake, leave this as a default but provide a dpkg-reconfigurable way to get "open" as "xdg-open" instead (system wide).

Propose your solution

Attachments
No attachments.


Duplicates


Comments
cheesehead (Brainstorm admin) wrote on the 1 Sep 10 at 01:18
Brainstorm is indeed an appropriate venue for this. Approving.

dino wrote on the 1 Sep 10 at 08:55

1. So "open" breaks the expectation of a former mac user. Changing the functionality breaks the expectation of a Linux user...

2. Changing "open" might also break other software

3. If you prefer open to do something else don't force it to everyone else - just set an alias on your local machine. Btw I use the alias o=gnome-open (o is short and gnome-open rocks :p)

4. in /bin should only be fundamental functionality to boot a basic system up (that is not x, not gnome,...) So it would be /usr/bin/ anyway .

overall -1

Darwin Survivor (Brainstorm moderator) wrote on the 1 Sep 10 at 09:43
I've been through the conversion phase and I know how painful it can be when there are a couple things that you can never remember. The problem is that while this seems like a simple change, it is a very slippery slope. If this kind of change is approved, it could lead to adding everything from "del/move/copy" from windows to turning linux into an attempted clone of every other OS in the world.

Otus wrote on the 2 Sep 10 at 09:07
Regardless of the reasons behind the suggestion, the change itself appears to be quite reasonable. How many actually use the open command as it is now? I at least would definitely use the suggested one.

Darwin Survivor (Brainstorm moderator) wrote on the 2 Sep 10 at 09:13
You know, there has been a recent increase in the number of suggested terminal and filesystem (case sensitivity) changes. It might be a cool idea if ubuntu created a few standard .bashrc files that people could download. Each could be targeted at new users from different operating systems.

Mac users could get an "open" alias, windows users could get an "exec" alias, etc.

Auzy wrote on the 2 Sep 10 at 10:43
a .bashrc wont fix filesystem case sensitivity.. This must be an option built into the kernel or filesystem (because you can't change from a case insensitive filesystem back to a sensitive filesystem without proper checks safely).

Darwin Survivor (Brainstorm moderator) wrote on the 2 Sep 10 at 23:26
Ok, just to clarify, what part of the case-sensitive filesystem are you worried about? Are you worried that people will accidentally create 2 files with different cases (expecting a "replace file" dialog) or that people will not be able to find their files because they searched with the wrong case?

PaddyLandau wrote on the 15 Sep 10 at 09:40
This is crazy.

If you don't like the current function of 'open', simply create an alias for yourself in your .bashrc file.

It would have taken you seconds, unlike creating this proposal.

Remember that many people would have used 'open', and this would break their scripts; they would have to create aliases in their .bashrc scripts.

Also, this would change Ubuntu to make it inconsistent with all the other Linux distributions out there.

Definite no-no.


Post your comment