LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-05-2010, 03:21 AM   #1
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Question Zsh: Help Setting Prompt, Please


Hi. I've always used bash, but I'm giving zsh a try because I've heard it has some nifty features. However, I'm having trouble converting my bash prompt into proper syntax for the .zshrc. Here is the code in my .bashrc:

Code:
export PS1="\[\033[01;36m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] "
Following online documentation, I figured how to convert most of that over, so that all the right content displays. However, I can't get the color escape codes to convert over. They always just display literally. I tried something like this: (just for the first part)

Code:
export PROMPT="%{\e[01;36m%}%n@%m%{\e[0m%}"
But still no color, just the text above.
 
Old 02-05-2010, 03:34 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,842

Rep: Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004
I've never used zsh, but this page seems to have a good breakdown on setting the prompts for it, including color sequences.

http://www.understudy.net/custom.html#Z_color

ETA: This page says there's an option for loading a color array, allowing you to use names instead of literal sequences. I'm not 100% sure if this is available to the prompt or not though.

http://zshwiki.org/home/examples/compsys/colors

Last edited by David the H.; 02-05-2010 at 03:42 AM.
 
  


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
passing parameters from a unix shell prompt into a windows cmd.exe prompt nano2 Programming 1 09-01-2009 12:26 PM
Setting Proxy server from comand prompt linuxjamil Linux - Server 4 11-02-2008 09:34 AM
zsh rihab84 Debian 4 05-08-2008 07:43 AM
Problem setting new prompt on bash elbarto Linux - Newbie 5 01-17-2007 07:01 AM
Zsh rch Linux - General 0 05-22-2003 04:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:56 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