Skip to content

Theme/tokyonight - #2404

Merged
seefood merged 13 commits into
Bash-it:masterfrom
hiedanoajuu:theme/tokyonight
Sep 13, 2026
Merged

seefood merged 13 commits into
Bash-it:masterfrom
hiedanoajuu:theme/tokyonight

Conversation

@hiedanoajuu

Copy link
Copy Markdown
Contributor

Description

Add a new theme tokyonight for bash-it.

Motivation and Context

Based on bash-it's easy theme, this theme tokyonight replicates the look of Tokyo Night Preset for Starship.

How Has This Been Tested?

  1. Add the following statements to your ~/.bashrc
export BASH_IT_THEME='tokyonight'
  1. Reload your shell
. ~/.bashrc

Screenshots (if appropriate):

2026-08-30-151846_hyprshot

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@hiedanoajuu

Copy link
Copy Markdown
Contributor Author

It seems that go in the CI environment is too old to run shfmt. Perhaps it should be updated to 1.26.0 or higher.

@BarbUk

BarbUk commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

yeah, that's not good, the ci does a setup of a specific go version, but try to install the latest shfmt version.

I'll make a PR to fix that.

@hiedanoajuu

Copy link
Copy Markdown
Contributor Author

yeah, that's not good, the ci does a setup of a specific go version, but try to install the latest shfmt version.

I'll make a PR to fix that.

Thanks so much.

@seefood

seefood commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

merge from master now, #2405 fixed the CI.

@Bash-it Bash-it deleted a comment from ira-at-work Aug 30, 2026
@seefood

seefood commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

sorry, I replied from the wrong user :)

@seefood seefood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the theme! Found a couple of issues before this can merge:

Blocking — will fail CI

  • themes/tokyonight/tokyonight.theme.bash:13. /etc/os-release triggers shellcheck SC1091 ("not following") with no disable comment. Every other file in the codebase that sources an external file (nvm.plugin.bash, rvm.plugin.bash, virtualenv.plugin.bash, powerline-naked.base.bash, etc.) adds # shellcheck disable=SC1091 for exactly this reason. Running shellcheck on this file locally confirms it exits non-zero, and there's no .shellcheckrc/severity override in this repo to mask it — the pre-commit shellcheck hook will fail on this PR as submitted.

Worth addressing

  • Same line — sourcing /etc/os-release without localizing its variables leaks ID, NAME, VERSION, PRETTY_NAME, etc. into global scope, and re-parses the file on every single prompt render (since distro_prompt_info runs via PROMPT_COMMAND). Since the distro doesn't change during a session, consider caching the parsed value or scoping the variables to avoid polluting the user's shell namespace.

Nit

  • docs/themes-list/tokyonight.rst:26 has trailing whitespace before the . ~/.bashrc code block (not CI-blocking, just a stray artifact).

Everything else looks good — shfmt is clean, no naming collisions with other themes' helper functions, and the RST doc renders correctly.

@hiedanoajuu

Copy link
Copy Markdown
Contributor Author

Thanks a lot for the review. It is late here. I will address these issues tomorrow.

- Address PR issues
- Optimize code structure
- Change the behavior of prompt character: color for exit code and shape
for user
Move shellcheck to the right place
The caches for nodejs and rust may return out-of-date versions
@hiedanoajuu

Copy link
Copy Markdown
Contributor Author

I have addressed the issues mentioned above. Please review again.

@seefood seefood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not ideal but acceptable. LMK if you want me to merge or if you want to have another go at improving the metadata cache.

Comment thread themes/tokyonight/tokyonight.theme.bash Outdated
@seefood

seefood commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@hiedanoajuu still working on it or should I merge?

- Cache distro/nodejs/rust at startup
- Tweak function and var name
@hiedanoajuu

Copy link
Copy Markdown
Contributor Author

I'm sorry that I have been busy with something else in the past few days. Please review it again.

@hiedanoajuu

Copy link
Copy Markdown
Contributor Author

Is the metadata cache up to your expectations? Could you please merge it at your convenience?

@seefood

seefood commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Yup, it's great, just GitHub threw 503 at me. I'll try again.

@seefood
seefood merged commit 4725d29 into Bash-it:master Sep 13, 2026
6 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.

3 participants