Konsole root session ignores bash completion - Debian

This is a discussion on Konsole root session ignores bash completion - Debian ; I have the following lines in my /etc/bash.bashrc uncommented (in the default installation, they are commented out) to get enhanced tab completion in Bash (not only completing file names as normal, but also things like package names on the aptitude ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Konsole root session ignores bash completion

  1. Konsole root session ignores bash completion

    I have the following lines in my /etc/bash.bashrc uncommented (in the
    default installation, they are commented out) to get enhanced tab
    completion in Bash (not only completing file names as normal, but also
    things like package names on the aptitude command line):

    # enable bash completion in interactive shells
    if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
    fi

    For some reason, when starting a root shell in Konsole from the Sessions
    menu, this setting is ignored. Other session types work as expected,
    and if one issues su from the root session (effectively starting a root
    shell within the root shell), things are fine too.

    Is anyone else seeing this?

    --
    Alex Nordstrom
    http://lx.n3.net/
    Please do not CC me in followups; I am subscribed to debian-kde.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQBDxdb4dL9K0uOVY4ERAnJAAJ920lsVkqINmFqF56GZMo AyG/z/VwCfUIIl
    CgVD6mpqHwG0N5MrZMhaKsg=
    =s5wt
    -----END PGP SIGNATURE-----


  2. Re: Konsole root session ignores bash completion

    El jueves, 12 de enero de 2006 05:11, Alex Nordstrom escribió:
    > For some reason, when starting a root shell in Konsole from the Sessions
    > menu, this setting is ignored. Other session types work as expected,
    > and if one issues su from the root session (effectively starting a root
    > shell within the root shell), things are fine too.
    >
    > Is anyone else seeing this?


    Me. I think that it is due that default konsole is not launched with -l flag,
    that is, to act like a login shell, loading startup scripts and so on. Your
    "su -" is working because you specify specifically with '-' that you want to
    read such files.

    Best regards,


    Ender.
    --
    So much to do, so little time...
    -- Joker (Batman).
    --
    Desarrollador de Debian
    Debian developer

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQBDxiWZWs/EhA1iABsRAqCuAKCAUzb2V36ICAr8fKT7EkXx1v+G0QCeNpG7
    mIuJapgDUgpJnFqb7tWiKNc=
    =orIP
    -----END PGP SIGNATURE-----


  3. Re: Konsole root session ignores bash completion

    Thursday, 12 January 2006 17:47, David Martínez Moreno wrote:
    > El jueves, 12 de enero de 2006 05:11, Alex Nordstrom escribió:
    > > For some reason, when starting a root shell in Konsole from the
    > > Sessions menu, this setting is ignored. Other session types work as
    > > expected, and if one issues su from the root session (effectively
    > > starting a root shell within the root shell), things are fine too.
    > >
    > > Is anyone else seeing this?

    >
    > Me. I think that it is due that default konsole is not launched with
    > -l flag, that is, to act like a login shell, loading startup scripts
    > and so on. Your "su -" is working because you specify specifically
    > with '-' that you want to read such files.


    It doesn't sound like an entirely unlikely theory, and if that's the
    case, it would be related to #279347.

    However, I didn't actually su with the "-" option, and the bash manual
    states that interactive shells, even if they are not login shells, will
    still execute the bashrc file unless the --norc option is also given.
    Also note that in a non-root Konsole session, everything works.

    The bash manual further says it won't read the bashrc file if it is
    invoked as sh. printenv shows that SHELL=/bin/bash regardless of how
    it's invoked, so how can I tell the difference? If one executes a
    non-existant command, the prompt suggests the shell is "-su", where it
    would normally say "bash" or "sh":

    # nonexistant
    -su: nonexistant: command not found

    In a normal Konsole session, this prompt says "bash", as expected.

    Any ideas?

    --
    Alex Nordstrom
    http://lx.n3.net/
    Please do not CC me in followups; I am subscribed to debian-kde.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQBDxkz8dL9K0uOVY4ERAkhFAKCafxKw63EeMJ0oWaxMdX N3leI08ACfW5zn
    pgTpFqmxDV+tLsmtNMwy6CQ=
    =uLPA
    -----END PGP SIGNATURE-----


  4. Re: Konsole root session ignores bash completion

    > Any ideas?

    strace -f -e trace=execve konsole

    gives :

    execve("/bin/zsh", ["/bin/zsh", "-c", "su -"], [/* 48 vars */]) = 0
    execve("/bin/su", ["su", "-"], [/* 47 vars */]) = 0


    my own shell is zsh, so konsole does :

    $(SHELL) -c "su -"

    to launch a root session.
    soit should defininetely do the same as you typing 'su -' in a shell.
    (meaning it creates a login shell with root's $(SHELL)).

    maybe your root has /bin/sh as a shell ?


    --
    ·O· Pierre Habouzit
    ··O madcoder@debian.org
    OOO http://www.madism.org

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQBDxmQ/vGr7W6HudhwRAjZ4AKCNViw6gFC5aKSU8SUTLPe3JApPQQCfR6 R9
    gfDWNY0nbwM1z5i4MN3fxbg=
    =vqoZ
    -----END PGP SIGNATURE-----


  5. Re: Konsole root session ignores bash completion

    Please respect my signature and Reply-To header as well as the Debian
    lists' code of conduct; do not CC me in followups.

    Thursday, 12 January 2006 22:14, Pierre Habouzit wrote:
    > my own shell is zsh, so konsole does :
    >
    > $(SHELL) -c "su -"
    >
    > to launch a root session.
    > soit should defininetely do the same as you typing 'su -' in a shell.
    > (meaning it creates a login shell with root's $(SHELL)).
    >
    > maybe your root has /bin/sh as a shell ?


    Nah, it's Bash, but as it turns out, I see the same issue if I execute
    "su -" rather than just "su", so it appears to be an issue with the
    behaviour of su rather than Konsole, and therefore, I guess this is the
    wrong list for the matter. Thanks to everyone who chipped in, though.

    --
    Alex Nordstrom
    http://lx.n3.net/
    Please do not CC me in followups; I am subscribed to debian-kde.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQBDykNFdL9K0uOVY4ERArz1AJ0TirOPBD+ljhy+i0eKPD PNmXuTiACeP6Ai
    MZ+bMasQ0iiL36Rdjcpbcnw=
    =H6K9
    -----END PGP SIGNATURE-----


+ Reply to Thread