Skip to content

[question] niu ignores ~/.bashrc, reads ~/.niubashrc — migration path? #1158

Closed

Description

@caomengxuan666

[question] niu ignores ~/.bashrc, reads ~/.niubashrc instead — migration path?

echo 'echo MARKER' > ~/.bashrc
bash -i -c 'echo AFTER'   # prints MARKER + AFTER
niu -i -c 'echo AFTER'    # prints AFTER only

Mirror test with ~/.niubashrc → niu reads it, bash ignores it. Possibly intentional (different shell, different rc name — like zsh vs bash), but then every ~/.bashrc-based setup is silently dead under niu and first-run migration needs an answer (auto-import? warning?). Needs triage, not necessarily a code fix.

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

Activity

  1. added
    question
    on Oct 22, 2026
  2. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Triage facts (rubash engine @ e743db8, WSL GNU 5.3.20):

    • GNU interactive non-login sources ~/.bashrc (verified: env HOME=fakehome bash -i -c → bashrc runs).
    • The rubash engine implements the GNU file names on non-Windows builds: nonlogin_interactive_files() sources /etc/bash.bashrc + ~/.bashrc (src/invocation.rs:495); .niubashrc is not an engine name.
    • On Windows, rubash.exe sources no startup files at all — run_startup_files is #[cfg(not(windows))]-gated (src/main.rs:1497-1541, "no real login concept… no sourcing, no regression"). Verified: rubash.exe -i reads neither .bashrc nor .niubashrc.
    • ~/.niubashrc is therefore a niu-host startup choice layered on top of the engine, not an engine behavior. The migration-path question (auto-import .bashrc? warning?) is a product decision for the niu host — the engine side already follows GNU naming where it sources files at all.

    Leaving open as a product question rather than an engine bug; no P-label applied.

  3. added a commit that references this issue on Oct 23, 2026
  4. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Retest on niu 1.4.4 / rubash 1b14a3d vs GNU bash 5.3.20 (isolated HOME with both files present):

    HOME=$fake timeout 10 niu -i -c 'echo hi'
    RC-NIURAN
    hi
    HOME=$fake timeout 10 niu -i -c 'echo hi'   # .niubashrc removed, only .bashrc
    hi
    

    niu -i still reads only ~/.niubashrc and ignores ~/.bashrc entirely. Per #1187 (scope note): the engine contract shipped, but niu.exe runs its own startup chain (niubash-runtime::shell::run_startup_files) — the niubash-side delegation is still pending. Reopening to track the product follow-up.

  5. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Engine side verified fixed (rubash -i reads .bashrc, with .niubashrc fallback). Remaining concern is niu-host startup delegation — tracked separately. Closing engine-side.

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

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions