prompt

[TR][TD]
For my mksh I use:
Code:
export PS1='$(printf "\1\r\1\033[0;32m\1%${COLUMNS}s\1\033[0m\1\n" "[ ${PWD} ]")'$'\1\r\1\033[0;32m\1$\1\033[0m\1 '

[/TD][/TR]
 
My .tcshrc prompt:
Code:
if ($?prompt) then

    set autoexpand
    set color
    set colorcat
    set filec
    set autolist     = ambiguous
    set correct     = cmd
    set history     = 2048
    set histfile     = ~/.tcsh_history
    set mail     = (/var/mail/$USER)
    set savehist    = 2048
   
    set autorehash     = always

    set grey     = "%{\033[1;30m%}"
    set red     = "%{\033[1;31m%}"
    set green     = "%{\033[1;32m%}"
    set yellow     = "%{\033[1;33m%}"
    set blue     = "%{\033[1;34m%}"
    set magenta     = "%{\033[1;35m%}"
    set cyan     = "%{\033[1;36m%}"
    set white     = "%{\033[1;37m%}"

    set end     = "%{\033[0m%}"

        if ( $tty =~ ttyv* ) then

            if ( $USER == root ) then
                set prompt = "\n${blue}%~ ${red}%N@%m: \n>>>${end} "
            else
                set prompt = "\n${red}%~ ${blue}%m: \n>>>${end} "
            endif

        else

            if ( $USER == root ) then
                set prompt = "\n${blue}%~ ${red}%N@%m: \n❱❱❱${end} "
            else
                set prompt = "\n${red}%~ ${blue}%m: \n❱❱❱${end} "
            endif

        endif

    unset grey red green yellow blue magenta cyan white end
 
Since discovering misc/py-powerline-status I've just used that, but tweaked the defaults a bit. My __main__.json:
Code:
{
     "segment_data": {
          "hostname": {
               "args": {
                    "only_if_ssh": true
               }
          },
          "cwd": {
               "args": {
                    "dir_limit_depth": 2
               }
          }
     }
}
...and default.json:
Code:
{
     "segments": {
          "left": [
               {
                    "function": "powerline.segments.common.net.hostname",
                    "priority": 10
               },
               {
                    "function": "powerline.segments.common.env.user",
                    "priority": 30
               },
               {
                    "function": "powerline.segments.common.env.virtualenv",
                    "priority": 50
               },
               {
                    "function": "powerline.segments.shell.cwd",
                    "priority": 10
               },
               {
                    "function": "powerline.segments.shell.jobnum",
                    "priority": 20
               }
          ],
          "right": [
               {
                    "function": "powerline.segments.shell.last_pipe_status",
                    "priority": 10
               },
               {
                    "function": "powerline.segments.common.vcs.branch",
                    "priority": 40
               }
          ]
     }
}
Just don't use it on slow machines as it's really inefficient. But it makes everything so pretty :oops:.
 
I'm old fashioned.

PS1='\h:\w$ '
PS2='\h:> '

I have in the past used more complex prompts, but I just keep returning to this.
 
A cut-n-paste from somewhere, plus some fiddling. The "precmd" does some magic that fixed something I could not. It has caused no problems. In $USER/$HOME/.cshrc:
alias precmd 'set prompt = "\n%{\033[32m%}%m [%h] [%@]%b%{\033[0m%} [`pwd`]$ "'

And for root:
alias precmd 'set prompt = "\n%{\033[31m%}%m [%h] [%@]%b%{\033[0m%} [`pwd`]# "'
 
Does anyone have any good prompts that they could share?
Here is my zsh shell prompt,
it shows the number of background jobs,
if you got 1 or more bg jobs, also it shows current directory name
gGEOloJ.gif
Code:
PROMPT='%(1j.%j.) %B%F{green}%C %f%b%# '
 
Back
Top