8/15/2023 0 Comments Fish shell theme![]() ![]() ![]() When you first start typing in Fish, you will immediately notice that it has an autosuggestion feature where, as you type, fish will suggest commands to you based on your shell history.Īlso, you will notice the commands that you type will change color. It has a number of smart features and improvements when compared to other popular shells, namely Bash and Zsh. And even that can be concatenated into a single line if you insert the colors directly instead of setting variables.Fish is a user-friendly command line shell for Linux and MacOS. Where basically only the last bit is what makes the prompt. If then # Change prompt colors for root user # a case would tend to support setf rather than setaf.) (Lack of such support is extremely rare, and such # We have color support assume it's compliant with Ecma-48 For the same prompt, including checks for color support etc, the full bash equivalent for this in my. Mind you, sometimes bash is a lot simpler. This helped me to create some more scripts and functions to make my life in fish easier and simpler. This exercise greatly helped me to understand the fishshell scripting language. This prompt was, as the top comments indicate, not all my own and heavily borrowed and modified other prompt and resources. Note: the latest version of this script can always be found on my GitHub here. # Some code stolen from oh-my-fish clearance theme: Įcho -n (set_color -bold yellow)\((set_color -bold red)$USER(set_color -bold yellow)?(set_color -bold red)$fqdn(set_color -bold yellow)\) (set color normal)Įcho -n (set_color -bold blue)\((set_color -bold white)$USER(set_color -bold blue)웃(set_color -bold white)$fqdn(set_color -bold blue)\) (set color normal)Įcho -n (set_color -bold yellow) (set_color normal)Įcho -n (set_color -bold blue) (set_color normal)Įcho (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')Įcho (command git status -s -ignore-submodules=dirty 2> /dev/null)Įcho -n (set_color yellow) $git_info (set_color normal)Įcho -n (set_color -bold yellow)"╭─"(set_color normal)Įcho -n (set_color -bold blue)"╭─"(set_color normal)Įcho (set_color -bold yellow)"╰─""# "(set_color normal)Įcho (set_color -bold blue)"╰─""\$ "(set_color normal)Įcho (set_color red) ↵ $st (set_color normal) # Theme based on Bira theme from oh-my-zsh: # Bira theme from oh-my-fish listed abouve, based on: # Created, modified and where possible bluntly stolen by throttlemeister. # This theme also based on the default bash prompt of Kali Linux. # This theme is based on Bira theme from oh-my-fish () To get this prompt, I created the following fish_prompt.fish under ~/.config/fish/functions. This was the result: fish prompt for root and regular user I had a pretty nice prompt setup in bash, so I really wanted my fish shell to look and feel similar. Or you want it to look the same or similar to your previous shell because that is what you are used to. With that out of the way, using a different or alternate shell can be fun but you probably also want it to look good. It’s great as your interactive shell when working the console though. I do not consider fish to be a replacement for bash and it should not be the default shell on any system. As such, for shell scripts that will need to work on any system you will still need to know how to script in sh/bash/ksh/etc. Note: important note if you are considering to use fish, fish is not a POSIX compliant shell. I like how programming the shell works and it has some very nice features like syntax and command highlighting you will not find in regular shells. ![]() Fish stands for Friendly Interactive Shell. Windows Terminal running Ubuntu in WSL2 with Fish ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |