Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm in the process of rescuing my information from the grips of MS Win 7. Been experimenting with Linux Mint for about 2 months. Currently working off of a full 20.1/Cinnamon install on a USB. Forgive me for not being more useful to this conversation. But I'm just happy to be HERE for now. I'm still trying to forget "C:'Backslash'". My best regards to each of you.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,818
Rep:
Quote:
Originally Posted by GazL
Some folks will certainly find that useful. I really dislike it when you're getting deep in the filesystem hierarchy and your prompt is taking up over half the screen width.
Yeah. I used to have a nifty prompt that I set up for my accounts back in my VMS days that would limit the directory portion of the prompt to no more than than the last 10-12 characters or so or the default directory (the pwd in the Unixverse). I've never quite been able to duplicate it on UNIX/Linux. I use "\W" in my PS1 and it keeps things short by stripping off all but the last bit of the pwd which I don't care for. Does "bin" mean I'm in "$HOME/bin" or "/usr/local/bin"? (Now, having mentioned that, I'll probably wind up spending an hour working on that tomorrow. :^D )
Distribution: UNK: (NEW Workstation) AMD 5900X w/64GB; CentOS 7 (Workstation) AMD FX 6300 w/32GB;
Posts: 74
Rep:
Quote:
Originally Posted by PaulvSchaik
Using a fancy zsh theme with this script:
Using a fancy zsh theme with this script:
Quote:
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m %{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m %{$reset_color%}'
local user_symbol='$'
fi
local current_dir='%{$terminfo[bold]$fg[blue]%}%~ %{$reset_color%}'
local git_branch='$(git_prompt_info)'
local rvm_ruby='$(ruby_prompt_info)'
local venv_prompt='$(virtualenv_prompt_info)'
It result is a 2 line colorful prompt with user, location and GIT info.
Ah!!! ZSH!! I switched from BASH to ZSH. I never knew there could be so many prompt themes. My current ZSH prompt is:
# Theme with full path names and hostname
# Handy if you work on different servers all the time;
PROMPT="[%B%F{cyan}%n%f@%F{red}%m%F{white}:%F{green}%~%F{white}%}]%F{magenta}%}/%F{yellow}%}>%F{white}"
Way back in DOS days I was so enthused at PC as approaching a magic lamp Genii, and probably way over-estimating my own skills , I made my prompt say "Yes Master?" LOL
These days, in Linux, I'm happy with almost anything but substantially prefer it display username or root. I never use sudo so with "su" I like to see "root" in my prompt. Similarly I like running File Managers as root often so I setup very different color schemes for User and root so the difference becomes instinctive. It is a bonus if directory is listed but really not a requirement for me. If a prompt does, that's fine. If it doesn't, that's OK too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.