On Fri, 2016-09-02 at 08:09 +0000, philip chimento gmail com wrote:
> On Thu, Sep 1, 2016 at 5:43 AM Michael Catanzaro <mcatanzaro gnome or
> g> wrote:
> > On Tue, 2016-08-30 at 21:25 +0000, philip chimento gmail com wrote:
> > > I've been thinking about the exact same thing recently; how about
> > a
> > > 'jhbuild jump' command that will take you from a location under
> > > srcdir to
> > > the corresponding location under builddir and vice versa? And
> > perhaps
> > > have
> > > some environment variables defined as well.
> >
> > It could run 'jhbuild shell' if UNDER_JHBUILD is unset, then do the
> > jump. That would be useful.
>
> I soon ran into the should-have-been-obvious-in-hindsight limitation
> that you can't change the parent process's working directory from a
> jhbuild command.
In the python world we have `pew`, which allows to maintain
effortlessly your virtual environments. Virtual environments are like
the Python equivalent of the jhbuild shell.
One thing that is amazing with pew is that it provides a
$ pew workon $project
command which both activates the virtualenv **and** move you to the
source directory of the project you asked to work on.
Which sounds similar to what you'd like for `jhbuild jump` (except that
would place you into the builddir, not the scrdir).
The way pew does that it simply runs a new shell in the right working
directory.
Couldn't `jhbuild jump` do the same?
Certainly could, though I didn't go for that immediately because I was afraid of shells piling up. For me at least, the intended usage would have been when I am already inside of a jhbuild shell. E.g., when a build fails and I start a shell from the menu, I end up in the builddir and I'd like to quickly get to the srcdir from there.
How do others feel about jhbuild jump always starting a new shell?
Regards,
Philip C