feat: add multi-shell architecture with Zsh support#593
Open
ki11e6 wants to merge 4 commits intobasecamp:masterfrom
Open
feat: add multi-shell architecture with Zsh support#593ki11e6 wants to merge 4 commits intobasecamp:masterfrom
ki11e6 wants to merge 4 commits intobasecamp:masterfrom
Conversation
Introduces shell-adapter pattern allowing users to choose between Bash and Zsh during installation or switch shells post-installation. Changes: - Add defaults/shared/ for shell-agnostic configs (environment, aliases, functions) - Add defaults/zsh/ adapter with zsh-specific settings and bash compatibility options - Refactor defaults/bash/ to use shared configs - Add shell selection to first-run-choices.sh - Rewrite a-shell.sh installer with dual-shell support - Add Shell menu to omakub CLI with switch functionality - Add shell-switch.sh for post-install shell switching with backup/migration
- Rewrite app2folder-remove() to use POSIX-compatible IFS loop instead of bash-specific 'read -ra' array syntax - Add arrow key history search bindings to zsh completions (equivalent to bash inputrc functionality)
mise's activation script uses $+functions[name] syntax which is incompatible with zsh's KSH_ARRAYS option. Temporarily disable KSH_ARRAYS during mise activation and re-enable it afterward. This prevents the "(eval):7: bad output format specification" warnings that appeared when using mise with Omakub's zsh configuration.
- Remove auto-migration of customizations between shells - Show user where customizations are saved for manual review - Add note that some commands may need shell-specific adjustments - Clean up zsh prompt file formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a shell-adapter architecture that enables Omakub to support multiple shells. This PR introduces Zsh as an alternative to Bash while maintaining full backward compatibility.
Key Changes
Shell-agnostic shared configs (
defaults/shared/):environment.sh- PATH, exports, OMAKUB_PATHaliases.sh- All command aliasesfunctions.sh- Utility functions (POSIX-compatible)Zsh adapter (
defaults/zsh/):shell- Zsh options with bash compatibility (KSH_ARRAYS, etc.)rc- Sources shared configs + zsh-specificinit- Tool initialization (mise, zoxide, fzf)prompt- Minimal Nerd Font promptcompletions.zsh- Tab completion + arrow key history searchBash adapter refactor (
defaults/bash/):Installer updates:
first-run-choices.sh- Shell selection during installa-shell.sh- Dual-shell installation supportCLI integration:
shell.sh- Shell selection menushell-switch.sh- Switch logic with backupArchitecture
Testing
Tested ✓
bash -n,zsh -n)omakubCLI menuapp2folder-remove()function (fixed for POSIX compatibility)Not Tested
Notes
chshbehavior)$+functions[...]syntax incompatibility