mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 08:02:24 +00:00
The rcfile tty7 hands to bash replays the login-shell startup chain, but sourced ~/.bashrc unconditionally after it. A login shell never does that on its own — ~/.bashrc arrives only because the profile that won the chain forwarded to it, which is how nearly every ~/.bash_profile is written. The result was the user's whole ~/.bashrc running twice per pane: banners printed twice, completions were sourced twice, and appends to PROMPT_COMMAND stacked up. Move ~/.bashrc into the same first-match-wins chain. That fixes the double source and still keeps the fallback for a $HOME with no profile at all. The existing test only asserted the rcfile mentions ~/.bashrc, which the buggy version satisfied too. Add one that runs real bash against a throwaway $HOME whose .bash_profile forwards, and counts the sourcings. Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>