Dash: Alt-F2 "nautilus ~/" errors to "Could not find '/~'"

Bug #734762 reported by Paul Sladen
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
Fix Released
Medium
Ian Liu Rodrigues
unity-lens-applications
Fix Released
Medium
Ian Liu Rodrigues
unity (Ubuntu)
Fix Released
Medium
Ian Liu Rodrigues
unity-place-applications (Ubuntu)
Fix Released
Undecided
Ian Liu Rodrigues

Bug Description

  1. Alt-F2
  2. Type: nautilus ~/ [enter]
  3. Click on first icon ("nautilus ~/"
  4. Dialogue pops up saying 'Could not find '/~'"

NOTE: the '~' and '/' have been swapped around between the dialogue and text-entry box!

Tags: bitesize patch

Related branches

Changed in unity:
assignee: nobody → Didier Roche (didrocks)
importance: Undecided → Medium
status: New → Triaged
milestone: none → 3.6.8
Changed in unity (Ubuntu):
status: New → Triaged
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Thinking about it, that can be a nice bitesize :)

Changed in unity:
milestone: 3.6.8 → 3.8
assignee: Didier Roche (didrocks) → nobody
tags: added: bitesize
Changed in unity:
assignee: nobody → Bilal Akhtar (bilalakhtar)
status: Triaged → In Progress
Changed in unity-place-applications:
assignee: nobody → Bilal Akhtar (bilalakhtar)
importance: Undecided → Medium
milestone: none → 0.2.44
status: New → In Progress
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

The problem here is that GLib.Process.spawn_async automatically prepends the current working directory to any args string specified which begins with '~'. I have tried all possible solutions with the below tiny vala app and have failed.

using GLib.Process;

static void main()
{
    Process.spawn_async(null, {"nautilus", "~"}, null, SpawnFlags.SEARCH_PATH, null, null);
}

We could manually check before the call to spawn_async and replace all args strings beginning with ~, with the home directory itself. This will be more of a workaround than a fix. No SpawnFlags are there to avoid GLib from the substitution, so this seems to be the only solution.

Changed in unity (Ubuntu):
status: Triaged → In Progress
Changed in unity-place-applications (Ubuntu):
status: New → In Progress
Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

I won't be fixing this one, since the fix as specified in comment #2 may produce unexpected results. Hence, I am un-assigning myself.

Changed in unity:
assignee: Bilal Akhtar (bilalakhtar) → nobody
status: In Progress → Confirmed
Changed in unity-place-applications:
assignee: Bilal Akhtar (bilalakhtar) → nobody
status: In Progress → Confirmed
Changed in unity (Ubuntu):
status: In Progress → Triaged
Changed in unity-place-applications (Ubuntu):
status: In Progress → Triaged
Changed in unity:
status: Confirmed → Triaged
Changed in unity-place-applications:
status: Confirmed → Triaged
Changed in unity-place-applications (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Ian Liu (ian-liu88)
Revision history for this message
Ian Liu Rodrigues (ian-liu88) wrote :

The problem is that nautilus tries to open a file name '~' in the current working directory. This can be reproduced in the shell by running

nautilus '~'

I can see these options to solve this bug:
1. Call bash when executing commands. This implies that any bash substitution variable would occur. For instance, pressing Alt+F2 and typing "nautilus $HOME" would open the home directory.

2. Substitute the tilde character with the home directory. I find this dangerous, since we could make a wrong assumption of what the user wanted. We could think of ways to restrict tilde substitution, for instance, only substitute tilde when: 1) tilde is the first character; 2) the file should exist on system.

I would like to hear more opinions!

Ian L.

Revision history for this message
Ian Liu Rodrigues (ian-liu88) wrote :

Here is a patch which fixes this bug by executing "bash -c <command>"

Changed in unity:
status: Triaged → In Progress
assignee: nobody → Ian Liu (ian-liu88)
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Ian,

unfortunately your current patch is just a workaround and is breaking a lot of cases where bamf tries to match the application to a desktop file.
What we really need is a solution where ~ is interpreted in the runner application to be changed by home, as well as ~user1, ~user2… and so on.

Changed in unity:
milestone: 3.8 → 3.8.2
tags: added: patch
Changed in unity (Ubuntu):
status: Triaged → In Progress
Changed in unity-place-applications:
status: Triaged → In Progress
Changed in unity:
status: In Progress → Fix Committed
Changed in unity (Ubuntu):
status: In Progress → Invalid
Changed in unity-place-applications:
status: In Progress → Fix Committed
Changed in unity-place-applications:
assignee: nobody → Ian Liu Rodrigues (ian-liu88)
milestone: 0.2.44 → none
status: Fix Committed → Fix Released
Changed in unity:
status: Fix Committed → Fix Released
Changed in unity-place-applications:
milestone: none → 0.2.44
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-place-applications - 0.2.44-0ubuntu1

---------------
unity-place-applications (0.2.44-0ubuntu1) natty; urgency=low

  * New upstream release.
    - unity-applications-daemon crash when Software Center index is corrupted
      (LP: #620294)
    - Dash: Alt-F2 "nautilus ~/" errors to "Could not find '/~'" (LP: #734762)
    - unity-applications-daemon crash in unity_package_searcher_search()
      (LP: #739698)
    - unity-applications-daemon crash because of invalid docid 0 (LP: #744261)
    - Gnome-terminal doesn't start in user home directory when started from
      alt+F2 (LP: #736471)
 -- Didier Roche <email address hidden> Thu, 31 Mar 2011 15:09:07 +0200

Changed in unity-place-applications (Ubuntu):
status: In Progress → Fix Released
Changed in unity (Ubuntu):
status: Invalid → Fix Released
assignee: nobody → Ian Liu Rodrigues (ian-liu88)
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.