GNOME Bugzilla – Bug 323434
environment variable needs to expanded in run application.
Last modified: 2020-11-06 20:26:32 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 ~.
I m looking into this issue. Will be attaching the patch soon. Thanks.
Created attachment 56057 [details] [review] Attached patch will fix the bug
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); ...
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.
Could someone please review this patch.? Thanks
Could some one review this patch? Thanks in advance.!
vuntz: poke
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.
I'm taking a look at this now... Dunno what I'll find, my C is kinda rusty...
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.
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.
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
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.