From 1a55ca5bfd77a816685a8b5b560077b86dfd0aa9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 10 Feb 2025 13:21:04 -0800 Subject: README: additional installation notes. - Some advice about Bash configuration for people who are not Bash experts. Bash trips people up by reading different config files when run as a login shell versus non-login shell. --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 18352c4..e330e7e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,37 @@ instance by adding this line to `~/.bashrc`: This requires Bash 4.4 or higher. +## Additional Installation Notes + +Note that `~/.bashrc' is loaded only for non-login shells. When Bash runs as a +login shell, it runs `~/.bash_profile`. If customizations are placed in +`~/.bashrc`, then `~/.bash_profile` must source `~/.bashrc`. That's one +configuration style. Another style is to have customizations in a common +file like `~/.bash_config` (not an official Bash name). This file is then +sourced by both `~/.bashrc` and `~/.bash_profile`. + +Note that if Bash, when run as a login shell, does not find `~/.bash_profile`, +it looks for `~/.bash_login`, and if that is missing, then `~/.profile`. +If your environment uses these files, then you might want to integrate +Basta via those instead. If you introduce `~/.bash_profile` into a +user environment relying on `~/.bash_login`, you will suppress the use of +`~/.bash_login`. If you rely on `~/.profile` for customization, that +name is known to other shells. Since Basta works with Bash only, if you +hook it into `~/.profile` you need a piece of code there to only run Basta +if the shell is Bash. + +It makes sense to run Basta for both your login shell and for all recursive +interactive shells which are non-login shells. Hence, it should be +referenced from both `~/.bashrc` and from `~/.bash_profile`. Each Basta +invocations in a new shell will create its own status line, as seen in the +screenshot, helping you be aware that you are in a recursive session. The +inactive status line below the topmost one are frozen: they continue to record +the last time they were updated, and also show the working directory at that +time. Unfortunately, applications osmetimes clear the entire terminal, so that +these frozen status lines disappear. The only way to refresh them is to return +to their respective sessions (even if only termporarily vi a suspend +operation). + ## Reloading Basta supports hot reloading: if you make some changes to the -- cgit v1.2.3