Skip to content

Fix WSL startup compatibility for fastfetch configs#1

Open
adiXjinx wants to merge 1 commit intomainfrom
codex/fix-startup-script-for-wsl
Open

Fix WSL startup compatibility for fastfetch configs#1
adiXjinx wants to merge 1 commit intomainfrom
codex/fix-startup-script-for-wsl

Conversation

@adiXjinx
Copy link
Owner

@adiXjinx adiXjinx commented Feb 19, 2026

Motivation

  • Make the fastfetch presets and startup snippets work in Windows WSL and other terminals that lack kitty image protocol support or use different home paths.
  • Prevent failing startup blocks when fastfetch is not installed so fresh WSL installs do not break shells.

Description

  • Changed all fastfetch presets from "type": "kitty-direct" to "type": "auto" and replaced hardcoded /home/nobody_hear/Downloads/mikasa.png with the per-user path ~/.config/fastfetch/mikasa.png in fastfetch/*.jsonc and fastfetch/config.jsonc.
  • Modified the shell startup snippets in bash/.bashrc and zsh/.zshrc to only run fastfetch when it is available using && command -v fastfetch >/dev/null 2>&1.
  • Updated Readme.md to use the new image path, hardened the startup instructions, and added a WSL Startup Script Not Working troubleshooting section with a no-image fallback and a manual test command (fastfetch --config ~/.config/fastfetch/T_Startup.jsonc --pipe false).

Testing

  • Ran a repository-wide search to confirm there are no remaining kitty-direct types or hardcoded /home/nobody_hear/Downloads/mikasa.png paths (command succeeded).
  • Performed syntax checks with bash -n bash/.bashrc and bash -n addisnals/Mikasa-update, both of which succeeded.
  • Attempted zsh -n zsh/.zshrc as part of a combined lint, but the check could not run here because the zsh binary is not installed in this environment (test noted as environment-limited).

Codex Task


Note

Low Risk
Doc and configuration-only changes; main risk is altered fastfetch logo rendering behavior in some terminals due to switching to type: auto and a new default image path.

Overview
Improves shell startup reliability by gating the startup fastfetch call in bash/.bashrc, zsh/.zshrc, and the README snippets behind command -v fastfetch, avoiding errors on systems where it isn’t installed.

Makes all fastfetch presets portable by switching logo rendering from kitty-direct to auto and replacing a hardcoded image path with ~/.config/fastfetch/mikasa.png across fastfetch/*.jsonc (including config.jsonc). Updates Readme.md accordingly and adds WSL-specific troubleshooting guidance and a no-image fallback ("logo": { "type": "none" }).

Written by Cursor Bugbot for commit 810beba. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Added availability checks to prevent startup errors when fastfetch is not installed.
    • Standardized image and configuration file paths to use a dedicated config directory.
  • Documentation

    • Updated setup guides to reflect new path expectations.
    • Added troubleshooting section with guidance for shell startup behavior and testing steps.

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Walkthrough

The changes add fastfetch availability checks to shell startup scripts and standardize fastfetch configuration file paths from absolute/Downloads locations to ~/.config/fastfetch. Logo rendering type is changed from direct kitty to automatic across all fastfetch configurations. Documentation is updated to reflect new paths and conditional checks.

Changes

Cohort / File(s) Summary
Shell Startup Scripts
bash/.bashrc, zsh/.zshrc
Add command availability check for fastfetch using command -v fastfetch >/dev/null 2>&1 to prevent execution when fastfetch is not installed.
Fastfetch Configurations
fastfetch/T_Cleanup.jsonc, fastfetch/T_Mikasaa.jsonc, fastfetch/T_Startup.jsonc, fastfetch/W_Command1.jsonc, fastfetch/W_Command2.jsonc, fastfetch/W_Command3.jsonc, fastfetch/W_Command4.jsonc, fastfetch/config.jsonc
Standardize logo configuration: change type from "kitty-direct" to "auto" and update image source paths from absolute paths to ~/.config/fastfetch/mikasa.png.
Documentation
README.md
Update onboarding instructions and examples to reflect new fastfetch config paths, add fastfetch availability conditionals in setup snippets, and introduce troubleshooting subsection for WSL startup behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With whiskers twitched and files aligned,
We check for fastfetch, no crash maligned,
From Downloads deep to config's home,
Standardized paths where configs roam,
Auto-detect the logo's glow,
Where ~/.config/fastfetch steals the show!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix WSL startup compatibility for fastfetch configs' accurately reflects the main change: adding WSL compatibility by fixing startup scripts and configuration paths for fastfetch presets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/fix-startup-script-for-wsl

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 and usage tips.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 8

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
zsh/.zshrc (2)

157-163: ⚠️ Potential issue | 🟠 Major

Incomplete guard coverage — bare fastfetch calls will still break on fresh WSL installs

The startup block on line 3 is now gated, but three other code paths call fastfetch unconditionally in unchanged code. On any WSL shell without fastfetch installed, these will produce fastfetch: command not found errors:

Location Trigger
Line 162 (second Mikasaa()) Calling Mikasaa from the prompt
Line 205 (clear() override) Every clear command in the shell
Lines 294, 298, 302, 306 (Mikasaa_check_command) Each keystroke that isn't I LOVE YOU while guard is active

The clear() case is the most disruptive since it fires on every screen clear.

🛡️ Proposed fix — guard all three locations
 function Mikasaa() {
   echo -e "\e[95m **#LOve_shea'sa-_Coming...\n"
   echo -e "\e[31m syncing emotional presence... complete."
   echo -e "\e[31m ↳ heartbeat: elevated (curious... excited?)"
   echo -e "\e[31m ↳ file: /home/sir/obsession/Mikasaa.conf is now locked 🔒"
-  fastfetch --config ~/.config/fastfetch/T_Mikasaa.jsonc
+  command -v fastfetch >/dev/null 2>&1 && fastfetch --config ~/.config/fastfetch/T_Mikasaa.jsonc
 }

 function clear() {
   command clear
-  fastfetch --config ~/.config/fastfetch/T_Cleanup.jsonc
+  command -v fastfetch >/dev/null 2>&1 && fastfetch --config ~/.config/fastfetch/T_Cleanup.jsonc
 }

Apply the same one-liner guard to each fastfetch call inside Mikasaa_check_command's case block (lines 294, 298, 302, 306).

Also applies to: 203-206, 272-314

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@zsh/.zshrc` around lines 157 - 163, Several fastfetch invocations are still
unguarded and will error on systems without fastfetch; update every
unconditional fastfetch call: add the same existence guard used in the startup
block before calling fastfetch in the Mikasaa() function invocation path, inside
the clear() override, and within each branch of Mikasaa_check_command (the case
branches that call fastfetch). Specifically, locate the Mikasaa() function, the
clear() override, and the Mikasaa_check_command case handlers and wrap each
fastfetch invocation with a check like the startup guard (ensure the fastfetch
command exists before calling it) so all code paths are protected on fresh WSL
installs.

38-163: ⚠️ Potential issue | 🟠 Major

Duplicate Mikasaa() definition — second shadows the first, making all sub-commands dead code

ZSH replaces a function definition on re-declaration. The second function Mikasaa() at line 157 silently overrides the full implementation at lines 38–154. As a result, Mikasaa update, Mikasaa install, Mikasaa gtdownloads, Mikasaa gthome, Mikasaa reload, and Mikasaa open all stop working — calling Mikasaa now only runs the short echo+fastfetch body.

Either remove the duplicate (lines 157–163) and merge its content into the first definition, or rename one of them.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@zsh/.zshrc` around lines 38 - 163, The problem is a duplicate function
definition: the second "function Mikasaa()" (containing the fastfetch and echo
block) overrides the full command dispatcher "Mikasaa" function, breaking all
subcommands; fix by removing the second definition or merging its fastfetch/echo
behavior into the first Mikasaa() dispatcher (or rename the second to a distinct
function like Mikasaa_status) so the original dispatcher (which handles
update/install/gtdownloads/gthome/reload/open) remains the active function;
ensure any helper references (e.g., fastfetch call and any hard-coded paths or
center_text usage) are moved into the primary Mikasaa implementation if you
merge.
bash/.bashrc (2)

134-134: ⚠️ Potential issue | 🟡 Minor

Unguarded fastfetch calls are inconsistent with the PR's WSL compatibility goal.

The startup block (Line 3) is now guarded, but three other call sites remain unconditional. On a fresh WSL install without fastfetch, these will emit fastfetch: command not found:

  • Line 134Mikasaa_display(), triggered via the Mikasaa alias.
  • Line 172 — inside the clear() override; every terminal clear will break.
  • Lines 255–268mikasaa_check_command() case arms.
🛡️ Proposed fix for the most impactful case (`clear` override)
 function clear() {
   command clear
-  fastfetch --config ~/.config/fastfetch/T_Cleanup.jsonc
+  command -v fastfetch >/dev/null 2>&1 && fastfetch --config ~/.config/fastfetch/T_Cleanup.jsonc
 }

Also applies to: 170-173, 255-268

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bash/.bashrc` at line 134, Guard all direct invocations of fastfetch by
checking its presence (e.g., command -v fastfetch >/dev/null) before calling it:
update Mikasaa_display(), the clear() override, and the mikasaa_check_command()
case arms to only run fastfetch when command -v fastfetch succeeds, and
otherwise skip it or fall back to a no-op; reference the functions/override by
name (Mikasaa_display, clear, mikasaa_check_command) and replace unconditional
fastfetch calls with a conditional guard around the single fastfetch invocation.

277-278: ⚠️ Potential issue | 🟠 Major

Bind without -x does not invoke shell functions — the Mikasaa GUARD is non-functional.

The binding at line 278 uses bind '"\C-m": mikasaa_check_command' without the -x flag. Per bash bind semantics, this syntax expects a readline function name (e.g., accept-line, beginning-of-line), not a shell command. Since mikasaa_check_command is a shell function, not a readline built-in, bash will fail with bash: bind: mikasaa_check_command: unknown readline function name on every shell start, and Enter will retain its default accept-line behavior — the guard never activates.

To fix, use bind -x to bind a shell command. This provides the function with access to READLINE_LINE and READLINE_POINT:

🐛 Proposed fix
-bind '"\C-m": mikasaa_check_command'
+bind -x '"\C-m": mikasaa_check_command'

With bind -x, the function runs with READLINE_LINE readable/writable. However, after the function returns, readline does not automatically re-submit the buffer; the user must press Enter a second time. To avoid this friction, consider a PROMPT_COMMAND-based hook instead, or document the double-press requirement.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bash/.bashrc` around lines 277 - 278, The bind currently uses a readline
function name instead of a shell command so mikasaa_check_command is not
invoked; change the bind to use bind -x '"\C-m": mikasaa_check_command' so the
shell function mikasaa_check_command executes and can read/write
READLINE_LINE/READLINE_POINT, and either handle the fact readline will not
re-submit the buffer (user must press Enter again) or instead move the logic
into a PROMPT_COMMAND-based hook to avoid the double-press UX issue.
🧹 Nitpick comments (2)
fastfetch/T_Mikasaa.jsonc (1)

90-90: Stale orphaned comment after the root } — safe to remove

// \n\u001b sits after the closing brace of the root object. It has no effect but is confusing noise.

🧹 Proposed cleanup
-}
-// \n\u001b
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@fastfetch/T_Mikasaa.jsonc` at line 90, Remove the trailing orphaned comment
string `// \n\u001b` that appears after the root closing brace `}` in
T_Mikasaa.jsonc; locate the stray line containing that exact sequence and delete
it so the file ends cleanly at the root `}` with no extraneous comments or
control-character noise.
fastfetch/config.jsonc (1)

5-6: Stale commented-out paths with the old hardcoded user directory still present

The active source was correctly updated, but lines 5–6 still contain the old /home/nobody_hear/Downloads/… references the PR intended to eliminate. These are misleading to anyone following this file as a reference.

🧹 Proposed cleanup
-    ///home/nobody_hear/Downloads/PikPng.com_anime-girl-transparent-png_5134206.png
-    ///home/nobody_hear/Pictures/terminal/PikPng.com_anime-girl-transparent-png_5134206-ascii-art.png
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@fastfetch/config.jsonc` around lines 5 - 6, Remove the stale commented-out
hardcoded user paths found near the "source" entry that reference
"/home/nobody_hear/Downloads/…" and "/home/nobody_hear/Pictures/…"; either
delete those commented lines or replace them with neutral example paths (e.g.,
"~/Downloads/..." or an explicit "example" placeholder) so the config no longer
contains misleading, repo-specific references while keeping the active source
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@fastfetch/T_Cleanup.jsonc`:
- Around line 3-4: The configs use "source": "~/.config/fastfetch/mikasa.png"
with "type": "auto", which relies on tilde expansion added in fastfetch v2.41.0;
update the README prerequisites to explicitly require fastfetch v2.41.0+
(mention the exact version) and/or add a short installation check script in the
docs that runs fastfetch --version, parses the version, and aborts with a clear
message if the installed version is older than 2.41.0; ensure the note
references the affected config files (T_Cleanup.jsonc, T_Mikasaa.jsonc,
T_Startup.jsonc, W_Command1-4.jsonc, config.jsonc) and suggests using
$HOME-expanded absolute paths as a fallback if you prefer not to enforce the
version.

---

Outside diff comments:
In `@bash/.bashrc`:
- Line 134: Guard all direct invocations of fastfetch by checking its presence
(e.g., command -v fastfetch >/dev/null) before calling it: update
Mikasaa_display(), the clear() override, and the mikasaa_check_command() case
arms to only run fastfetch when command -v fastfetch succeeds, and otherwise
skip it or fall back to a no-op; reference the functions/override by name
(Mikasaa_display, clear, mikasaa_check_command) and replace unconditional
fastfetch calls with a conditional guard around the single fastfetch invocation.
- Around line 277-278: The bind currently uses a readline function name instead
of a shell command so mikasaa_check_command is not invoked; change the bind to
use bind -x '"\C-m": mikasaa_check_command' so the shell function
mikasaa_check_command executes and can read/write READLINE_LINE/READLINE_POINT,
and either handle the fact readline will not re-submit the buffer (user must
press Enter again) or instead move the logic into a PROMPT_COMMAND-based hook to
avoid the double-press UX issue.

In `@zsh/.zshrc`:
- Around line 157-163: Several fastfetch invocations are still unguarded and
will error on systems without fastfetch; update every unconditional fastfetch
call: add the same existence guard used in the startup block before calling
fastfetch in the Mikasaa() function invocation path, inside the clear()
override, and within each branch of Mikasaa_check_command (the case branches
that call fastfetch). Specifically, locate the Mikasaa() function, the clear()
override, and the Mikasaa_check_command case handlers and wrap each fastfetch
invocation with a check like the startup guard (ensure the fastfetch command
exists before calling it) so all code paths are protected on fresh WSL installs.
- Around line 38-163: The problem is a duplicate function definition: the second
"function Mikasaa()" (containing the fastfetch and echo block) overrides the
full command dispatcher "Mikasaa" function, breaking all subcommands; fix by
removing the second definition or merging its fastfetch/echo behavior into the
first Mikasaa() dispatcher (or rename the second to a distinct function like
Mikasaa_status) so the original dispatcher (which handles
update/install/gtdownloads/gthome/reload/open) remains the active function;
ensure any helper references (e.g., fastfetch call and any hard-coded paths or
center_text usage) are moved into the primary Mikasaa implementation if you
merge.

---

Duplicate comments:
In `@fastfetch/config.jsonc`:
- Around line 3-7: The config change updating the logo source is correct — no
code changes required; keep the "type": "auto" and the updated "source":
"~/.config/fastfetch/mikasa.png" as-is and remove any commented-out alternate
paths if you want a cleaner file (refer to the "type" and "source" entries to
locate the setting).

In `@fastfetch/T_Mikasaa.jsonc`:
- Around line 3-4: The review indicates this change is fine as-is — no code
changes required; keep the "type": "auto" and "source":
"~/.config/fastfetch/mikasa.png" fields in T_Mikasaa.jsonc unchanged to remain
consistent with the PR-wide logo update and approve the change.

In `@fastfetch/T_Startup.jsonc`:
- Around line 3-4: This change updates the logo entry to use auto-detection with
the new source path; no code changes required—leave the "type": "auto" and
"source": "~/.config/fastfetch/mikasa.png" fields in T_Startup.jsonc as-is to
remain consistent with the PR-wide logo update (verify only that the file path
exists and the image is accessible at runtime).

In `@fastfetch/W_Command2.jsonc`:
- Around line 3-4: The "source" value uses a tilde
("~/.config/fastfetch/mikasa.png") which may not be expanded by the consumer;
update the configuration so the path is absolute or uses an environment-expanded
form instead of "~". Locate the "source" key (with "type": "auto") and replace
the tilde-prefixed path with either an absolute path or a runtime-expanded value
(e.g., using $HOME or a loader that expands tildes) to match the same
tilde-handling change made in T_Cleanup.jsonc.

In `@fastfetch/W_Command3.jsonc`:
- Around line 3-4: Keep the tilde-expanded path in W_Command3.jsonc consistent
with the rest of the PR by applying the same version-gate used in
fastfetch/T_Cleanup.jsonc: ensure the "source": "~/.config/fastfetch/mikasa.png"
entry is only enabled/accepted under the same version constraint
comment/mechanism as T_Cleanup.jsonc so the tilde-handling behavior remains
uniform across the files.

In `@fastfetch/W_Command4.jsonc`:
- Around line 3-4: No change required — the "type": "auto" and "source":
"~/.config/fastfetch/mikasa.png" entries in W_Command4.jsonc correctly reflect
the PR-wide logo update; simply keep these values as-is (verify the referenced
file path exists in the target environment if needed) and proceed with the
approval.

---

Nitpick comments:
In `@fastfetch/config.jsonc`:
- Around line 5-6: Remove the stale commented-out hardcoded user paths found
near the "source" entry that reference "/home/nobody_hear/Downloads/…" and
"/home/nobody_hear/Pictures/…"; either delete those commented lines or replace
them with neutral example paths (e.g., "~/Downloads/..." or an explicit
"example" placeholder) so the config no longer contains misleading,
repo-specific references while keeping the active source unchanged.

In `@fastfetch/T_Mikasaa.jsonc`:
- Line 90: Remove the trailing orphaned comment string `// \n\u001b` that
appears after the root closing brace `}` in T_Mikasaa.jsonc; locate the stray
line containing that exact sequence and delete it so the file ends cleanly at
the root `}` with no extraneous comments or control-character noise.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant