LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 02: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, 02:34 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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 02:42 AM.
 
  


Reply



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 11:26 AM
Setting Proxy server from comand prompt linuxjamil Linux - Server 4 11-02-2008 08:34 AM
zsh rihab84 Debian 4 05-08-2008 06:43 AM
Problem setting new prompt on bash elbarto Linux - Newbie 5 01-17-2007 06:01 AM
Zsh rch Linux - General 0 05-22-2003 03:59 AM

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

All times are GMT -5. The time now is 04:51 AM.

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
Open Source Consulting | Domain Registration