Skip to content

[bug] Login+interactive shells skip the rc file #1159

Closed

Description

@caomengxuan666

[bug] Login+interactive shells skip the rc file (profile chain runs, rc never sourced)

# fakehome/.bash_profile = echo PROFILE-RAN, rc markers in ~/.bashrc / ~/.niubashrc
bash --login -i -c 'echo AFTER'  # BASH-RC, PROFILE-RAN, AFTER (profile chain AND rc)
niu --login -i -c 'echo AFTER'   # PROFILE-RAN, AFTER only

bash sources profile chain and rc; niu sources profile chain only. Medium: rc-defined aliases/functions missing in exactly the login-interactive sessions that need them most.

Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.

Activity

  1. added
    bug
    gnu-baseline
    area:cmdline
    P2-medium
    on Oct 22, 2026
  2. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Triage vs WSL GNU 5.3.20: NOT-A-BUG — the reported GNU behavior does not exist. A login+interactive shell sources the profile chain only; ~/.bashrc is never read by the login branch (shell.c:1833 if (login_shell) ... else if (interactive)).

    Verified against a clean fake HOME on GNU 5.3.20:

    $ env HOME=fakehome bash --login -i -c "echo AFTER"      → /etc/profile motd + PROFILE-RAN + AFTER   (no BASH-RC)
    $ env HOME=fakehome bash -i -c "echo AFTER"              → BASHRC-RAN + AFTER                       (non-login interactive only)
    

    The BASH-RC print on the filing machine came from its .bash_profile sourcing ~/.bashrc (standard distro/Termux profile). niu printing PROFILE-RAN only is exactly GNU behavior. Closing as completed (not a divergence).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumarea:cmdlinebuggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions