[SOLVED] help converting bash PS1 prompt to zsh PS1 prompt

I guess they don't use the same syntax because simply copying it over to my zshrc does not work... it literally changes my prompt to the exact string of backlslashes etc
If anyone can help me convert the following to zsh syntax I would be much in their debt:
    PS1="$TITLEBAR [\[\e[37m\]\u\[\e[31m\]@\[\e[37m\]\h\[\e[0m\]:\[\e[33m\]\w\[\e[0m\]] \$ ${NONE}"
full bit copied from some thread in this forums... it had served me well
bash_prompt() {
case $TERM in
xterm*|rxvt*)
local TITLEBAR='\[\033]0;\u:${NEW_PWD}\007\]'
local TITLEBAR=""
esac
local NONE="\[\033[0m\]" # unsets color to term's fg color
# regular colors
local K="\[\033[0;30m\]" # black
local R="\[\033[0;31m\]" # red
local G="\[\033[0;32m\]" # green
local Y="\[\033[0;33m\]" # yellow
local B="\[\033[0;34m\]" # blue
local M="\[\033[0;35m\]" # magenta
local C="\[\033[0;36m\]" # cyan
local O="\[\033[0;37m\]" # orange
local W="\[\033[0;38m\]" # white
# emphasized (bolded) colors
local EMK="\[\033[1;30m\]"
local EMR="\[\033[1;31m\]"
local EMG="\[\033[1;32m\]"
local EMY="\[\033[1;33m\]"
local EMB="\[\033[1;34m\]"
local EMM="\[\033[1;35m\]"
local EMC="\[\033[1;36m\]"
local EMW="\[\033[1;37m\]"
# background colors
local BGK="\[\033[40m\]"
local BGR="\[\033[41m\]"
local BGG="\[\033[42m\]"
local BGY="\[\033[43m\]"
local BGB="\[\033[44m\]"
local BGM="\[\033[45m\]"
local BGC="\[\033[46m\]"
local BGW="\[\033[47m\]"
local UC=$W # user's color
[ $UID -eq "0" ] && UC=$R # root's color
PS1="$TITLEBAR [\[\e[37m\]\u\[\e[31m\]@\[\e[37m\]\h\[\e[0m\]:\[\e[33m\]\w\[\e[0m\]] \$ ${NONE}"
#PS1="$TITLEBAR ${EMK}[${UC}\u${EMK}@${UC}\h ${EMB}\${NEW_PWD}${EMK}]${UC}\\$ ${NONE}"
# without colors: PS1="[\u@\h \${NEW_PWD}]\\$ "
# extra backslash in front of \$ to make bash colorize the prompt
PROMPT_COMMAND=bash_prompt_command
bash_prompt
unset bash_prompt
Last edited by ugkbunb (2009-09-04 17:56:55)

If it spits out errors you should read them.. They generally tell you what the script expects. I saved your prompt in test and passed it to the script:
$ perl tozsh.pl test && rm test
# Converted to zsh prompt theme by bash2zshprompt, written by <[email protected]>
[%{$fg[white]%}%n%{$fg[red]%}@%{$fg[white]%}%m%{$reset_color%}:%{$fg[yellow]%}%~%{$reset_color%}] \

Similar Messages

  • [Solved] How To Add Blank Space In Prompt With zsh

    How can I get zsh to show the full directory path I'm in, instead of just my hostname?
    Last edited by shoober420 (2014-07-31 16:53:51)

    You should be able to just add a space in your prompt. Can you post the prompt you have now?
    Have a look at https://wiki.archlinux.org/index.php/Color_Bash_Prompt
    PS1='[\u@\h \W]\$ '
    The prompt goes between the ' ' - the last two characters are $ and a space. Try doing something similar.

  • [SOLVED] Bash: Append file contents to command prompt

    Hi,
    is there a way to append the contents of a file to the command prompt? Say I have defined an alias and I want to change it on the fly. So I'd do
    $ which <my_alias>
    then mark it with the mouse, and paste it to the command line. What I would like to do instead, would be:
    $which <my_alias> > some_temp_file
    $vim some_temp_file #edit the command the way I want it
    $ # somehow get the file contents into the prompt here
    I did try to google it, but to no avail and I know, I could just create a script from some_temp_file but I want the content to appear at the command prompt instead. So is there a way?
    regards,
    mox
    Last edited by Mox (2014-03-07 15:46:09)

    Mox wrote:@progandy: Yes, this might be a step in the right direction. But what do the -i and -v options do? I did not find any documentation in the manpage. And is there a way to expand $COMMAND in the command line before running $COMMAND?
    Why do you want to have the command in a prompt twice? "read -er COMMAND && eval "$COMMAND"" creates a prompt-like environment and then executes the input string. What the options do you can read in the bash-internal help, e.g.:
    $ LC_ALL=C help read
    -e use Readline to obtain the line in an interactive shell
    -i text Use TEXT as the initial text for Readline
    -p prompt output the string PROMPT without a trailing newline before
    attempting to read
    -r do not allow backslashes to escape any characters
    Here is an example:
    [progandy@pamobile ~]$ alias some_test='echo -e Hello WORLD"!"'
    [progandy@pamobile ~]$ command_to_edit="some_test"
    [progandy@pamobile ~]$ read -erp "Edit and execute: " -i "$(command -v $command_to_edit)" COMMAND
    Edit and execute: echo -e Hello WORLD"\t!"
    [progandy@pamobile ~]$ ####### in the line above you edit the command and bring it in the final form with all necessary paramters.
    [progandy@pamobile ~]$ echo -E " *~* Now running: $COMMAND"
    *~* Now running: echo -e Hello WORLD"\t!"
    [progandy@pamobile ~]$ eval "$COMMAND"
    Hello WORLD !
    [progandy@pamobile ~]$
    Last edited by progandy (2014-03-05 05:21:39)

  • Help convert LV5.1vi to 8.x please.

    Can someone help convert the vi at the link below to a contemporary version of LV?
    http://zone.ni.com/devzone/cda/epd/p/id/558
    I don't have anything old enough installed to open it. I don't even know what it is, but one of my users requested it.
    Thanks in advance!
    Chris
    Solved!
    Go to Solution.

    Here it is in 8.2, though once you see it, I think you will find it would be easier to just use Read From Spreadsheet File.
    Attachments:
    parse_lookup_table.vi ‏23 KB

  • Need help converting from 4.0 to 2011

    hello,
    Need help converting files from 4.0 to 2011.
    thank you
    Solved!
    Go to Solution.
    Attachments:
    noise source.vi ‏73 KB
    8673D.vi ‏30 KB
    8970 FREQ.vi ‏26 KB

    attached as 8.2, which you can open
    missing some subVIs - not sure if you already have them
    Attachments:
    8673D.vi ‏13 KB
    8970 FREQ.vi ‏11 KB
    noise source.vi ‏24 KB

  • TS3899 I can receive, but not send emails on iPad. All settings checked several times and with internet provider. imap settings confirmed as ok. Account deleted and set up under guidance of service provider several times - problem not solved - help!!

    I can receive, but not send emails on iPad. All settings checked several times and with internet provider. imap settings confirmed as ok. Account deleted and set up under guidance of service provider several times - problem not solved - help!!

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Using a POP account with multiple devices
    http://support.apple.com/kb/ht3228
    iOS: Adding an email account
    http://support.apple.com/kb/HT4810
    iOS: Setting up an Outlook.com, Hotmail, Live, or MSN email account
    http://support.apple.com/kb/ht1694
    iPhone, iPad, iPod touch: Microsoft Outlook 2003, Outlook 2007, Outlook 2010 may not display contacts and calendars after sync
    http://support.apple.com/kb/TS1944
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    How to Sync Contacts with Your iPad Using iTunes
    http://www.dummies.com/how-to/content/how-to-sync-contacts-with-your-ipad-using- itunes.html
    iOS: 'Mailbox Locked', account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    iCloud: Create a group and add contacts to it
    http://support.apple.com/kb/PH2667
    eMail Groups - You can use a third party app that many users recommend.
    MailShot -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    Group Email  -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • Helpful Linux Bash Scripts for I.T. Admins

    I was wondering if you guys had any recommendations for helpful / simple Bash scripts that do helpful tasks in regards to Linux system administration? I have never created or used a Bash shell script but know that many of you guys do. I have no programming experience what so ever so decided to ask if you guys do have one or few scripts that are useful in basic administration tasks, could you please post them or at least point someone who is interested in the right direction?
    Thank you so much!

    I'm no sysadmin but one were to use command-line a lot i would give ZSH a shot. A nicely configured zsh shell can be unbelievably comfortable and is certainly a great tool.
    As for scripts I always thought of them as little helpers customized for certain situations. For instance easing repetitive tasks, batching some steps and timing/automating little things. For general purpose I'd probably look at available software first.
    Maybe tmux for terminal management, ranger for file management, a tiling window manager for efficiency, ssh and other survaillance/maintenance software? Personally, I'd very much like to hear, too, what software/scripts/.. linux systems admins use to keep the work to a minimum .

  • Help converting pdf forms to a word document

    Debbie
    I need help converting a pdf form to a word document.

    I just purchase adobe to be able to convert a pdf form into a word document but it is not working..

  • Help convert date

    hi help convert date
    April 26, 1904....August 12, 1979
    to dd/mm/yyyy

    SELECT CONVERT(VARCHAR(15),CAST('April 26, 1904' AS DATE),103)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Download helper converts to .flv instead of .avi

    since a few months when downloading a video from the same source, the download helper converts to .flv and no longer to.avi.
    what do I need to do to have .avi?
    Even if it downloads as .avi, it converts automatically to .flv .
    Thank you for help.
    Rgds pia

    The first thing that you need to consider is whether or not
    this project
    will work well on the web. If you have to make a bunch of
    compromises to
    get it working on the web, then it may not represent you
    well.
    That said, you can use FLVs in Director MX 2004 with the
    latest updates.
    However, you can't stream the FLVs, you have to encapsulate
    each one in
    an SWF and then use the SWF. So if its the streaming that
    you're after,
    you may want to use QT instead. You can stream that.
    Regardless of the video media that you use, you need to be
    sure that you
    aren't taking a smooth CD based experience and turning it
    into a click
    and wait, click and wait, less than elegant web experience.
    If you want
    to showcase your video capabilities then you may want to
    build a web
    specific tool. Or, you may want to let site visitors request
    a CD to be
    mailed to them.
    Rob
    Rob Dillon
    Adobe Community Expert
    http://www.ddg-designs.com
    412-243-9119
    http://www.macromedia.com/software/trial/

  • Need help converting Client-Server to JSP

    Hi;
    I have a purely data driven, dynamic, meta driven program
    in Java 1.4. Runs on almost any SQL database, and the
    systems analysts can do most of the programming just by
    entering the data. All screens and sql are auto-genned
    at runtime.
    I was wondering if there was anyone interested in helping
    convert to JSP. I would be willing to give part of the
    company profits. It is better then me asking a million
    questions here, although there are lots of great experts here.
    -Trent
    Thanks.

    My personal email address is [email protected] I would love to contact you if you drop me your phone number.
    Manohar

  • Need help converting a PDF to excel

    Need help converting a PDF to excel, the icon to convert dissappeared suggestions?

    Open the file in Acrobat, use File --> Save As... --> Microsoft Word.
    Mylenium

  • Zsh PS1 tty console color issues with newline

    So in a tty I get only white in my PS1 when I use 2 lines:
    PS1="%{%F{white}%}%~ %{%F{green}%}%{%f%}%(10l.
    .)>> "
    My old PS1 works fine though:
    PS1="%{%F{white}%}%~ %{%F{green}%}>> %{%f%}"
    Anyone have any ideas / workarounds?

    copy the rxvt-unicode-256color terminfo to ~/.terminfo/r/ on the remote and make sure your $TERM is set to it. If you get a error about it being too long either fix ssh on the remote, or just rename it and chante TERM acordingy.
    Last edited by Mr.Elendig (2011-05-28 08:03:05)

  • HOW TO CREATE PROMPT BASED ON ANOTHER PROMPT IN OBIEE

    HOW TO CREATE PROMPT BASED ON ANOTHER PROMPT IN OBIEE.
    Requiremenst is as follows.
    Year ,Qtr columns in first prompt.Based on selection on these prompts second prompt should display corresponding prompts
    Second prompt will have Month ,Week and Day columns.Second prompt should be hidden and based on first prompt selection second prompt should display with constraint based on first prompt.
    Any help would be highly appriciated!!!

    hi,
    Using Guided navigation it is possible,
    Please refer the below links.
    http://gerardnico.com/wiki/dat/obiee/dashboard_prompt_1_eq_0
    http://businessdecisionsystems.com/blog/?p=448
    Hope this help's
    Thanks,
    Satya

  • Restricting Prompt values until parent prompt is selected

    OK - this should be simple,but again its causing problems. I have a prompt with a series of drop downs based on the Organisation dimension. They are restricted so that they are filtered accordinly when the values are selected. I need to go one step further and not show any values until de parent value is selected. I am trying to do this with presentation variables and then using SQL to generate the values for each prompt passing as filter the variable for the parent prompt. I am getting an errors on the "@{var_name}" syntax.
    Has anyone managed to do this?

    Sorry, I thought that was what you were asking for (aside from the syntax of using prompts in the SQL statement). So please clarify again. When the user selects a value in the parent prompt, that value is stored in the PV. Now, what exactly do you want the users to see in the drop down of the child prompt?
    I just thought of something... Are all your prompts stored in one prompt file? If so, and the prompts are all set to Report Defaults, values in the prompts won't show until the drop down value is pressed and a value selected. Also, the prompt won't launch the report until the "Go" button is pressed. (By checking "constrain," each subsequent prompt will be properly constrained by the one before, as applicable.)
    If the prompts are in separate prompt files, then above would not be true.
    Message was edited by:
    LC143

Maybe you are looking for

  • Error while creating settlement rule

    We are trying to create a Settlement Rule for a Production Order for material 900010001 with following details: Cat:MAT Settlement Receiver:900010001 % :100 Settlement Type:FUL System is giving an error msg. no.KD063 'Distribution rule for an Article

  • Cannot use aipprint from iphone 4 with ios 5.0.1. does not find the hp m1212nf laser.

    have a hp m1212nf mfp(airprint compatible according to the hp web site) hooked up via usb to mac running OS 10.6.8., other mac hooked up via router to same network, Can print from both machines to the printer, which has the latest firmware installed.

  • Can't use serial parameters of parity ,but VB can?

    Recently I use java.com package develop, meet some question, hope genuinely experts of java help me quickly,my question: Now using java can open serial port,but when set parameters for serial port,arise exception of UnsupportedCommOperationException

  • PDF issues in Solaris

    Hello, I'm new in Solaris and I have some problems wiht PDF documents. OS: Solaris 10 s10s_u4wos_12b SPARC. I have the following issues: -PDF graphic icons are degraded; -When a PDF is opened in a new tab, the tab navigation doesn't work anymore and

  • On final cut pro x I keep trying to export but get the -50 error (something about quicktime)

    I've read the other threads and deleted all my render files, stopped background rendering, yet I still can't share my video. Any reason why I can't share?