Opened 5 years ago
Last modified 5 years ago
#4007 new enhancement
grass.py and bash: respect aliases in $HOME/.bashrc
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.3 |
Component: | Default | Version: | git-releasebranch78 |
Keywords: | bash | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
At time aliases defined in $HOME/.bashrc are not transferred into the GRASS GIS session (discussed in https://github.com/OSGeo/grass/pull/170 but not yet realised).
It would be way easier to work from command line if $HOME/.bashrc aliases were carried over into the current session.
As per variables.html, $HOME/.grass7/bashrc
has to be written by the user which is unneeded extra work. Why this separate bashrc was invented at all, is unknown to me...
Indeed, there has been some related discussion in Feb 2013:
https://lists.osgeo.org/pipermail/grass-dev/2013-February/061857.html (and following)
Perhaps we can solve this in 2019/2020 :)
Change History (7)
follow-up: 3 comment:2 by , 5 years ago
Replying to hcho:
A workaround (current master) is ...
To make this work in G78 as well, we would have to backport
https://github.com/OSGeo/grass/pull/170
...right? If yes, are there any any objections to do so?
comment:3 by , 5 years ago
Replying to neteler:
Replying to hcho:
A workaround (current master) is ...
To make this work in G78 as well, we would have to backport
https://github.com/OSGeo/grass/pull/170
...right? If yes, are there any any objections to do so?
You're right. No objection from me. Also, I guess this approach is better than "forcing" source ~/.bashrc
. Clean aliases vs. inheriting them. Choice as long as we have a separate bashrc.
follow-up: 7 comment:4 by , 5 years ago
ok I have backported it (pls squash-merge in future - I had to cherry-pick all commits individually).
Now: to be tested if it works in relbranch78
comment:6 by , 5 years ago
Milestone: | → 7.8.3 |
---|
comment:7 by , 5 years ago
Replying to neteler:
ok I have backported it (pls squash-merge in future - I had to cherry-pick all commits individually).
I thought I used the Squash and merge button in GitHub... Actually, this seems to be the only way to merge from there, I guess? Not sure what happened. Thanks for the backport!
Now: to be tested if it works in relbranch78
A workaround (current master) is to add
to
$HOME/.grass7/bashrc
.I kind of understand why we have this separate
bashrc
(history for each mapset), but I'm not sure why we have two different places to read this file ingrass.py
:load_env
(export
s) andbash_startup
(non-export
s). Hopefully, we can make it cleaner soon.