[haiku-commits] Re: r38133 - haiku/trunk/src/apps/terminal

  • From: Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 16 Aug 2010 11:44:29 +0200

2010/8/16 Ithamar R. Adema <ithamar.adema@xxxxxxxxxxxxxxxx>:
> On Mon, 2010-08-16 at 11:21 +0200, pulkomandy wrote:
>> Is there such thing as an user-selected shell somewhere in Haiku yet ?
>> This allows me to use multiple tabs in terminal for the time being.
>> Also note that the first opened tab is set up differently and also
>> always start bash (hardcoded as kDefaultShell in TermApp.cpp).

Hmmm but IIRC TermApp.cpp is the only place where the code checks for
the user selected shell...

const char *defaultArgs[2];
        defaultArgs[0] = kDefaultShell;
        defaultArgs[1] = "--login";

        struct passwd passwdStruct;
        struct passwd *passwdResult;
        char stringBuffer[256];
        if (!getpwuid_r(getuid(), &passwdStruct, stringBuffer,
                        sizeof(stringBuffer), &passwdResult)) {
                defaultArgs[0] = passwdStruct.pw_shell;
        }

The code should be centralized and used in the TermWindow::AddTab().

Other related posts: