Skip to content

Retain locally customized .bashrc (gedit defaults, alias fixes) with upstream synced - #1

Merged
DavidDAndrews merged 3 commits into
mainfrom
local/bashrc-customizations
Sep 14, 2026
Merged

DavidDAndrews merged 3 commits into
mainfrom
local/bashrc-customizations

Conversation

@DavidDAndrews

@DavidDAndrews DavidDAndrews commented Sep 14, 2026

Copy link
Copy Markdown
Owner

What this is

Retains the locally customized .bashrc and syncs the branch with upstream main.

~/.bashrc on this machine is a symlink into this repo, so this file is the live shell
configuration rather than a copy of it.

Contents

  1. Personalize .bashrc - editor defaults (nvim -> gedit), pager configuration, alias cleanup (35 insertions / 63 deletions).
  2. Fix broken aliases, dead GREP_OPTIONS, and dangling sedit references (22 insertions / 23 deletions).
  3. Merge upstream main (b96e064) - brings in upstream's infra changes: LICENSE, config.jsonc, uninstall.sh, starship-theme, shellcheck.log, the bashtest workflow and dependabot config, plus updates to README.md, setup.sh and starship.toml.

Deliberate decision: upstream's V2 .bashrc is not adopted

Upstream's CTT Bash V2 (94129d3) rewrote .bashrc wholesale (871 lines versus the 556 here). The merge resolved that single conflict in favour of the local version, so the live shell configuration is preserved unchanged.

This is also why this PR is scoped to the fork and is not proposed upstream: relative to upstream's main, the .bashrc diff is effectively a revert of the V2 rewrite, which is not a contribution that maintainer would want.

Overlap with upstream worth noting:

  • Upstream now defines sedit() itself (line 119 of its .bashrc), so the sedit -> sgedit repointing is superseded upstream but is still required by the .bashrc retained here.
  • Upstream independently dropped GREP_OPTIONS, matching the local fix.

Bugs fixed

  • export sgedit='sudo gedit' defined an environment variable rather than an alias, so sgedit was not invocable.
  • alias nano='nano' was a self-referential no-op.
  • spico/snano now follow the s-prefix-means-sudo convention already used by svi.
  • 13 call sites across apacheconfig(), phpconfig() and mysqlconfig() invoked sedit, which was defined nowhere (no alias, no function, no binary). All three functions were broken, and equally broken upstream before V2.
  • man -P most and PAGER=most assumed the most package, which setup.sh does not install. Both now sit behind a command -v most guard.

Verification

  • bash -n passes on .bashrc, setup.sh, uninstall.sh and starship-theme.
  • The project's own CI lint (shellcheck -f gcc over *.sh, per .github/workflows/bashtest.yml) reports zero findings.
  • shellcheck on .bashrc itself reports 0 errors (9 warnings, 20 notes). Note the CI never lints .bashrc, because find . -name "*.sh" does not match it.
  • Functional load test in a real interactive shell: all sampled aliases and functions resolve, with EDITOR=gedit and PAGER=most.
  • .bashrc sha256 is byte-identical to the pre-merge backup, so the live shell configuration did not change.

Conversation: https://app.warp.dev/conversation/7e6205a9-dbe4-4c06-b448-95b8ed246a72

Co-Authored-By: Warp agent@warp.dev

Summary by CodeRabbit

  • New Features

    • Added an hb command for uploading content to haste-bin.
    • Enabled fzf, Starship, zoxide, and atuin initialization consistently.
  • Changes

    • Simplified shell history, PATH, XDG, and distribution handling.
    • Standardized editing commands on gedit.
    • Updated configuration helpers to use the streamlined editor workflow.
    • Removed macOS and multi-distribution fallback handling, along with several legacy helper commands and aliases.

dandrews and others added 3 commits September 14, 2026 17:28
Documents the local customizations to the tracked .bashrc in this clone
(~/linuxtoolbox/mybash), which is the live file via the ~/.bashrc symlink
created by setup.sh. Relative to upstream main: 35 insertions, 63 deletions.

Interactive-shell guard
- Add an early `[[ $- != *i* ]] && return` so non-interactive shells leave
  the file before running interactive-only setup.

Editor defaults (nvim -> gedit)
- EDITOR/VISUAL: nvim -> gedit.
- pico/spico now map to gedit; nano/snano map to nano.
- Add `alias vi='nvim'` alongside the existing `alias vim='nvim'`.

Aliases
- ls: `ls -aFh` -> `ls -laFh --color=always` (long format by default).
- less: add `-R --use-color -Dd+r -Du+b`.
- man: add `alias man="man -P most"`.
- svi: now `sudo nvim`; add `findall="sudo find / | grep "`.
- ebrc -> editrc (`gedit ~/.bashrc`).
- Re-enable the GREP_OPTIONS block and the `grep` alias.
- Remove the `freshclam`, `web`, and `hug` (hugo server) aliases.

Pager and man-page colors
- Relocate the LESS_TERMCAP_* definitions to the tail of the file, switch
  them from `$'\E[...'` to `printf '\e[...'`, adjust the md/so/us colors,
  and add `export PAGER="most"`.

Startup hooks
- Add `. "$HOME/.atuin/bin/env"` after `atuin init bash`.

Removals
- Drop the redundant `install_bashrc_support()` helper.

Known issues carried in this change, deliberately not fixed here:
- `export sgedit='sudo gedit'` creates an environment variable rather than
  an alias, so `sgedit` is not invocable from an interactive shell.
- `alias nano='nano'` is a self-referential no-op.
- GREP_OPTIONS was removed in GNU grep 2.21; this host ships 3.11, so the
  re-enabled GREP_OPTIONS block has no effect.
- `man -P most` and `PAGER=most` depend on the `most` package.

Verified: `bash -n .bashrc` passes. gedit, most, nvim, starship, zoxide,
atuin, and trash are all present on this host, and ~/.atuin/bin/env exists.

Co-Authored-By: Warp <agent@warp.dev>
Follow-up to the .bashrc customization commit. Addresses defects
introduced by that change plus one pre-existing upstream breakage.

- sgedit: `export sgedit='sudo gedit'` defined an environment variable
  rather than an alias, so `sgedit` was not invocable. Now an alias.
- grep: drop the GREP_OPTIONS export and the alias that expanded it.
  GREP_OPTIONS is ignored by GNU grep >= 2.21 (this host has 3.11), so
  the block was dead code. Replaced with `alias grep='grep --color=auto'`.
- nano: drop `alias nano='nano'`, a self-referential no-op, now that
  /usr/bin/nano is confirmed to be on PATH.
- spico/snano: apply the s-prefix-means-sudo convention already used by
  svi and sgedit. `spico` was an exact duplicate of `pico`; it is now
  `sudo gedit`, and `snano` is now `sudo nano`.
- sedit: 13 call sites across apacheconfig(), phpconfig() and
  mysqlconfig() invoked a command defined nowhere on the system (no
  alias, no function, no binary), so all three functions were broken.
  They were equally broken upstream, which only ever referenced sedit
  without defining it. Repointed at the `sgedit` alias, which is also
  semantically correct: every target is a root-owned file under /etc.
- most: `alias man='man -P most'` and `export PAGER='most'` assumed the
  `most` package, which setup.sh does not install. Both now sit behind a
  `command -v most` guard, so `man` falls back to its default pager
  instead of failing on a machine without it.

Verified: `bash -n .bashrc` passes; each corrected alias resolves when
sourced in a clean `bash --norc` shell; `type -a nano` resolves to
/usr/bin/nano. On this host `most` is installed, so pager behavior is
unchanged from before this commit.

Co-Authored-By: Warp <agent@warp.dev>
Brings the upstream changes accumulated since 4e92a96 into this branch.
Upstream's non-.bashrc changes all applied cleanly: LICENSE,
config.jsonc, uninstall.sh, starship-theme, shellcheck.log, the bashtest
workflow and dependabot config, plus updates to README.md, setup.sh and
starship.toml.

.bashrc was the only conflict, because upstream's "CTT Bash V2"
(94129d3) rewrote it wholesale (871 lines vs 556) while this branch
carries local customizations on the previous version. Resolved in favor
of the local version so the live shell configuration is preserved
unchanged.

Consequences, deliberately accepted:
- Upstream's V2 .bashrc is not adopted into the live config. It remains
  available on `main` for a deliberate port later.
- Upstream now defines sedit() itself (line 119 of its .bashrc), so the
  sedit -> sgedit repointing in 1faac98 is superseded upstream but still
  applies to the local .bashrc retained here.
- Upstream independently dropped GREP_OPTIONS too, matching 1faac98.

Verified before committing: .bashrc sha256 equals the pre-merge backup
(2205d9a4c451a608745c58933b549a19025e02036ea076cd9d8ad8d4567ba824),
no conflict markers, `bash -n .bashrc` passes, and ~/.bashrc resolves to
the same content.

Co-Authored-By: Warp <agent@warp.dev>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6da4e3c7-9ea4-47c6-bdf3-251cd57858de

📥 Commits

Reviewing files that changed from the base of the PR and between b96e064 and 93df8f0.

📒 Files selected for processing (1)
  • .bashrc

📝 Walkthrough

Walkthrough

The PR simplifies .bashrc by removing platform fallbacks, consolidating aliases and functions, changing editor and command defaults, simplifying distribution detection and PATH setup, and making several shell integrations unconditional. It also adds an hb upload function.

Changes

Shell configuration and command behavior

Layer / File(s) Summary
Startup settings and aliases
.bashrc
Startup handling, history synchronization, editor settings, aliases, command probes, and filesystem helpers are simplified or made unconditional.
Utility function behavior
.bashrc
Archive, copy, move, directory, paste, and SSH helpers lose fallback branches or validation. Deleted helpers include docker-clean and sshperms.
System helpers and configuration editing
.bashrc
Distribution detection and system helper functions use fewer platform branches. Apache, PHP, and MySQL configuration functions use locate and sgedit.
Shell integrations and PATH setup
.bashrc
The hb upload function is added. PATH setup uses one append, and starship, zoxide, and atuin initialization becomes unconditional.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Other

Suggested reviewers: christitustech

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch local/bashrc-customizations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DavidDAndrews
DavidDAndrews merged commit 267bd51 into main Sep 14, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant