0
votes
0answers
49 views

zsh/Prezto: difficulties with right prompt alignment

This may be stupidly simple, but... I am trying to make my own prompt for Prezto. I have been using numerous prompts for reference (I can post a list if necessary). My RPROMPT and cursor are refusing ...
1
vote
1answer
71 views

Show path from project root in ZSH Prompt

If my pwd is ~/repos/blog/app/views/, I'd like to show only blog/app/views in the prompt i.e. I want to show only the project root. Project root is the parent directory of .git directory. Is there a ...
1
vote
1answer
35 views

Expansion in zsh prompt

I'm struggling with zsh prompt, trying to convert my bash prompt to zsh hooks. This code should display the current kerberos ticket and update accordingly, but colors don't work, neither does the ...
3
votes
2answers
118 views

Asynchronous RPROMPT?

A friend of mine posted this on StackOverflow, and I thought we might be more likely to get an answer here. His post refers to speed, but we now know that the python script we are using to parse git ...
1
vote
1answer
106 views

Mysterious repeating of entered command in shell

After booting up my system and logging in (before starting X, I start it manually via startx) I suddenly get the following output after entering a command: $ cmd ;user@host: cmd;cmd;cmd; [output of ...
3
votes
2answers
143 views

How change prompt of subshell

I'm trying to create a simple script that, among other things, will create a subshell: #!/bin/sh # setup "${@:-$SHELL}" # teardown The question is: I need to change the default prompt, so for ...
3
votes
1answer
223 views

zsh adds tab character when autocompleting

I have zsh 4.3.10 installed on a RHEL 6.4 box. I'm not sure why this happens, but when I but Tab to autocomplete things, it also adds a tab character. For example: rocket@rhelbox www % vim vim ...
5
votes
2answers
377 views

Wrap command in the prompt

Is it possible to insert a separator after the command in a prompt? This is an example: ~/Desktop: ls -al ------------------------------------- total 80 drwx------+ 6 eddie staff 204B Apr 29 ...
1
vote
1answer
74 views

Displaying ~ for $HOME in zsh prompt

I have my prompt set to the following: PROMPT=%F{reset}[%F{blue}%2/%F{reset}] which displays two parent directories as [foo/bar] However, when I'm in $HOME or one directory deep in $HOME, I'd ...
0
votes
3answers
467 views

Proper place to put shell prompt(PS1) when use sh/bash/zsh together

I'm using dash(sh) or bash or zsh. If possible, I would prefer to put in common place. I want to put proper PS1 settings when I interactive with shell, so these situation should be considered login ...
2
votes
0answers
538 views

Problems changing PS1 to use special character

I'm trying to get my zsh to look something like this: https://bbs.archlinux.org/viewtopic.php?pid=1068202#p1068202. Whenever I print the └───╼ part of the PS1 to my terminal (or in the .zshrc for ...
2
votes
1answer
240 views

zsh prompt not escaped properly

This is my current prompt definition: PROMPT='%(?..%F{red}%?%f:)%F{blue}%n%f:%F{green}%{${PWD/#$HOME/~}%} %(!.%F{red}.%f)%# %f' The cursor sometimes starts one character behind the actual prompt, ...
1
vote
1answer
471 views

Colors not rendered correctly in oh-my-zsh themes

I'm trying to use colors in oh-my-zsh themes. It works fine on my home computer (ubuntu), but in a work computer (Scientific Linux i.e. Enterprise linux) the prompt colors are actually spelled out. ...
1
vote
1answer
126 views

zsh delete part of the prompt

When I use reverse history search, then it "eats" a part of my prompt. Sometimes when I type a long command which spans to multi lines, my prompt is also lost. Have anyone experience this situation? ...
1
vote
3answers
353 views

Reevaluate the prompt expression each time a prompt is displayed in zsh

I'm adjusting my zsh prompt, based upon the dallas theme and the dstufft theme from oh-my-zsh. I love how dallas has various sections of the prompt contained in variables, which makes it much easier ...
2
votes
1answer
226 views

ZSH %m prompt escape not working as documented under Debian Linux

The zshmisc man page on my new Debian Squeeze install states, under SIMPLE PROMPT ESCAPES: %m The hostname up to the first `.'. An integer may follow the '%' to specify how many components of the ...
2
votes
2answers
278 views

Shell Prompt Customization? [closed]

I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off. My usual shell is ...
0
votes
2answers
246 views

pwd not being set correctly in zsh prompt

If I type this in my PROMPT in my .zshrc file: PROMPT="`pwd` >" I expect that it will print the current working directory. However, pwd always prints /Users/kevin. Why doesn't it show my current ...
3
votes
1answer
1k views

Set variables in ZSH precmd and reference them in the prompt

Is there a way to set variables in the precmd function of zsh and then echo them in the prompt? Something like function precmd { GREETING='Hi Kevin!'; } PROMPT="$GREETING";
5
votes
5answers
325 views

Conflict between my prompt definition and cat in zsh

I have a file on a remote filesystem that I know has a short text string in it (a sequence of numbers in a single line). If I open the file on a text editor like nano or Emacs I can see the string. ...
6
votes
1answer
186 views

How can I output “temporarily” to the shell, like zsh tab completion does?

In zsh shell, when you hit Tab twice to get tab completion, your options are displayed below your prompt. But when you make a selection, the options disappear. I have a little script that outputs ...
1
vote
1answer
128 views

Printing evaluated prompt placeholders to screen

Is there a way to print interpreted PS1 variable placeholders to console? Something like $ echo `%u` for printing a username or $ echo `%h` for printing a host. I do know about environment ...
7
votes
3answers
563 views

Can I highlight the current prompt line in zsh?

Is it possible to highlight (set a background colour) for the whole line of the prompt in zsh? In my emacs config I have the line on which the cursor sits a slightly different colour to the window ...
8
votes
2answers
1k views

How do you make RPROMPT in zsh update itself on every enter?

My RPROMPT is set to display svn info using vcs_info. It reads RPROMPT=${vcs_info_msg_0_}. vcs_info is called using precmd(). However, RPROMPT doesn't update when I change directories. It works only ...
3
votes
2answers
3k views

change prompt color depending on user or root in zsh

in zsh you can have a %# in your PS1 (or whatever PROMPT variable) which basically means display % if user or display # if root. I'm wondering if there is any way to affect this so that the % or # ...
2
votes
1answer
292 views

vi mode doesn't display correctly on new term

This is a continuation of my previous questions. I currently have the following in ~/.zsh.d/functions.sh function zle-line-init zle-keymap-select { psvar[1]="${${KEYMAP/vicmd/}/(main|viins)/-- ...
3
votes
3answers
740 views

Is there a way to make the prompt definition multiline?

This is my current prompt definition: PS1=$'%F{063}%1~%f %(1v.%F{099}%1v %f.)%F{063}%%%f ' RPROMPT='$VIMODE %m' and I'm working on integrating this. Basically I'm starting to find it very ...
18
votes
2answers
2k views

Display stuff below the prompt at a shell prompt?

Lets's say my prompt looks like this (the _ represents my cursor) ~ % _ Is there any way I could make it look like this ~ % _ [some status] The question was originally about zsh, but now has ...
16
votes
3answers
5k views

make my zsh prompt show mode in vi mode

I use bindkey -v (for bash-ers set -o vi I think that works in zsh too) or vi(m) mode. but it bugs me that I don't have any visual cue to tell me whether I'm in insert mode or command mode. Does ...