Tagged Questions
4
votes
2answers
99 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
40 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
2answers
128 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
222 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 ...
1
vote
1answer
109 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
262 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
92 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
154 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
161 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
209 views
Shell Prompt Customization?
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
159 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 ...
2
votes
1answer
517 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";
4
votes
5answers
261 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
138 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
93 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
382 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 ...
6
votes
2answers
972 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
2k 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
267 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
562 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 ...
15
votes
2answers
1k 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 ...
10
votes
3answers
3k 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 ...