LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-23-2019, 03:05 PM   #1
Froggg
LQ Newbie
 
Registered: Feb 2019
Location: Coldwater, OH
Distribution: Debian
Posts: 5

Rep: Reputation: Disabled
ZSH Help


Just getting into CLI in general and ZSH in particular and would like some help. FYI, I'm running Debian 9.8. Hope this is the right place to ask this. I have my normal users prompt set in ~/.zshrc as follows:

if [[ $UID = 1000 ]]; then
PS1='%B%F{yellow}%T %~ %# %F{reset_colors} '
else
PS1='%B%F{red}%T %~ %# %F{reset_colors} '
fi

which works fine, but when I switch to root user, using 'sudo su' my prompt shows the '#' as it should, but the letters are plain and black, not red and bold. How (where) do I set it the root prompt (or root $PS1) so the lettering shows red? Any and all help0 is greatly appreciated.

Froggg aka Dave
 
Old 02-23-2019, 03:16 PM   #2
Froggg
LQ Newbie
 
Registered: Feb 2019
Location: Coldwater, OH
Distribution: Debian
Posts: 5

Original Poster
Rep: Reputation: Disabled
ZSH help

Never Mind, I found it. But, in case anyone else ran into the same problem, go into /root/.zshrc and put the desired prompt there.

Froggg
 
Old 02-23-2019, 04:50 PM   #3
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.5
Posts: 2,565

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
Welcome to LQ.

Yes, each user has its own .zshrc (or .bashrc, if using bash). Note that the test is not actually necessary...the UID will always be that of the user (1000 in your example).

You may mark your thread SOLVED using the thread tools.
 
1 members found this post helpful.
Old 02-25-2019, 07:22 PM   #4
Froggg
LQ Newbie
 
Registered: Feb 2019
Location: Coldwater, OH
Distribution: Debian
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks

Scacey, many thanks for the reply and tip.

Froggg
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Setup ZSH and Oh-my-zsh on Linux LXer Syndicated Linux News 0 11-02-2017 12:42 AM
Zsh: Help Setting Prompt, Please CoderMan Linux - Software 1 02-05-2010 02:34 AM
help during installation with zsh stuartmcgeown Red Hat 1 05-12-2006 08:04 AM
zsh equivalents in bash saurya_s Linux - General 1 01-04-2004 03:06 AM
Zsh rch Linux - General 0 05-22-2003 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration