After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 323434 - environment variable needs to expanded in run application.
environment variable needs to expanded in run application.
Status: RESOLVED OBSOLETE
Product: gnome-panel
Classification: Other
Component: run dialog
git master
Other All
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-12-07 06:20 UTC by Ramprakash Jelari
Modified: 2020-11-06 20:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Attached patch will fix the bug (2.76 KB, patch)
2005-12-16 05:13 UTC, Ramprakash Jelari
needs-work Details | Review
Attached patch fixes the bug. (2.88 KB, patch)
2006-01-20 13:05 UTC, Ramprakash Jelari
needs-work Details | Review
Expand Env Variables (2.79 KB, patch)
2007-10-02 16:28 UTC, Kevin Kubasik
needs-work Details | Review

Description Ramprakash Jelari 2005-12-07 06:20:47 UTC
Steps to simulate:
 - Open run application.
 - try to run a binary present in your $HOME : 
   "$HOME/<executable file>" or "~/<executable file>.

Observation:
Error dialog pops up with below message:
  "Cannot display location 'file://$HOME/button'
   Details: There is no default action associated with this location."

Expected:
Run application should expand the $HOME env as well as ~.
Comment 1 Ramprakash Jelari 2005-12-12 11:33:45 UTC
I m looking into this issue.  Will be attaching  the patch soon. Thanks.
Comment 2 Ramprakash Jelari 2005-12-16 05:13:10 UTC
Created attachment 56057 [details] [review]
Attached patch will fix the bug
Comment 3 Vincent Untz 2005-12-28 20:00:49 UTC
I need to look at some old bugs because I remember some discussions about this.

If we want to do this, we want to do it everywhere. Eg "nautilus ~/" and "nautilus $HOME" should all work (and maybe "nautilus ${HOME}" too).

Some comments:
 * don't forget to add spaces where necessary
 * about this:
+                if (g_str_has_prefix (vector[i],"$"))  {
+                        temp = g_strsplit_set (vector[i],"$",0);
+                        xpanded = g_getenv (temp[1]);
This could be:
if (vector[i][0] == '$') {
  temp = vector[i] + 1;
  expanded = g_getenv (temp);
  ...
Comment 4 Ramprakash Jelari 2006-01-20 13:05:43 UTC
Created attachment 57725 [details] [review]
Attached patch  fixes  the bug.

I have modified the patch so as to take care of all the cases mentioned in
comment #3.
Comment 5 Ramprakash Jelari 2006-02-20 15:30:38 UTC
Could someone please review this patch.?

Thanks
Comment 6 Ramprakash Jelari 2006-07-11 11:48:05 UTC
Could some one review this patch? 

Thanks in advance.!
Comment 7 André Klapper 2006-07-26 10:45:37 UTC
vuntz: poke
Comment 8 Vincent Untz 2007-01-15 22:49:57 UTC
The patch will not work for "gedit ~/file" and I'm not sure it will work for "gedit --user=$USER" either.

Also, we really want to use GString here.
Comment 9 Kevin Kubasik 2007-09-11 17:59:54 UTC
I'm taking a look at this now... Dunno what I'll find, my C is kinda rusty...
Comment 10 Kevin Kubasik 2007-10-02 16:28:56 UTC
Created attachment 96524 [details] [review]
Expand Env Variables

Feedback is much appreciated, this isn't a complete patch (no changelog, and has the old method commented out) but if its what we need, then I'll check in a polished version.
Comment 11 Vincent Untz 2007-11-13 10:30:57 UTC
I looked quickly at the patch a few weeks ago, but I forgot to comment. My first reaction was that it doesn't deal with "gedit ${myfavoritetextfile}", so it should be a bit more complex.

tmp2 sounds useless. Something like tmp[strlen(tmp)-1] = '\0' should work.

Also, I don't understand the LC_CTYPE stuff.

Note that we also probably want to expand the tilde not only at the beginning of the string, but everywhere.
Comment 12 Christopher Roy Bratusek 2008-03-27 07:24:52 UTC
Hmm. I started to re-write the panel-run-dialog in pygtk, 'cause we can get Environment Variable Expanding without extra code. The new gnome-run-dialog would also close #77300 and #109557 (<- in case for the root user).

You might have a look, here: http://www.gnomefiles.org/app.php/Gnome-Run-Dialog
Comment 13 André Klapper 2020-11-06 20:26:32 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years.

If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/gnome-panel/-/issues/

Thank you for reporting this issue and we are sorry it could not be fixed.