[openbeos] Re: Including additional Tracker add-ons

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 11 Dec 2007 22:57:47 +0100

On 2007-12-11 at 16:26:03 [+0100], Stefano Ceccherini 
<stefano.ceccherini@xxxxxxxxx> wrote:
> 2007/12/11, Ralf Schülke <teammaui@xxxxxx>:
> 
> > > Only Shell::_Spawn() needs to be changed, probably. One way it could
> > > do that is check if the supplied argument have a trailing slash and,
> > > if so, pass it to bash in some (other) way (I'm sure bash supports
> > > opening a terminal in a given path).
> >
> > So can you do ist :-)?
> > stargater
> >
> I guess I could. Although I don't know if this has some consequences.
> In other words: how is a terminal supposed to behave if someone passes
> a path as its commandline parameters ?

I don't really see a reason to change the Terminal at all. It's not the 
problem in this case. The problem is that when started as login shell, bash 
changes the cwd to the home directory.

One way to work around this is to start the shell as non-login shell:

        Terminal /bin/sh

This opens a Terminal with a shell in the current directory. Though it has 
the disadvantage that the shell doesn't load the usual startup scripts 
(/etc/profile, ~/.profile).

A little more complex, but without disadvantages (well aside from leaving a 
mini temp file):

        echo "cd $(pwd)" > /tmp/sh_env$$; ENV=/tmp/sh_env$$ Terminal

IOW, the Tracker add-on has to create a one-line shell script, that cds 
into the desired directory, and set the ENV environment variable to point 
that script.

CU, Ingo

Other related posts: