Live data from Hacker News

An adaptive prompt for Bash and Zsh

github.com

21–22 of 22 posts

Re: An adaptive prompt for Bash and Zsh

#21
post #13

I use PS1='$ ' on the local machine and 'foo$ ' if I've ssh'd to foo. I prefer this because: the location of the cursor is more fixed, it doesn't wander across the columns as the environment changes, so my eye finds it more quickly; I've a decent amount of line left before it wraps at the end of the terminal, and I often type 100+-character pipelines on the fly; a couple of taps of Enter gives almost blank lines that…

Solution to that: multi-line prompts. First line with lots of info, second line just '$ '. Or RPROMPT if you are using zsh ([...] RPROMPT parameter. If this is set, the shell puts a prompt on the right side of the screen.)

That wouldn't give the sequence of almost-blank lines I find most helpful. It would also merge the first, long, line of the prompt with the tail of the previous command's output.

Re: An adaptive prompt for Bash and Zsh

#22
post #19

Earlier quoted context omitted.

what version of ZSH are you using? I'm having issues installing this on Ubuntu where the metadata commands aren't executing and are instead printed as $vcs_info_msg_0_`git_dirty` $username `cmd_exec_time`

Latest - 5.0.2

Interesting. I installed 5.0.2, removed anything that would be interfering with my .zshrc and still have the same problems.
Post reply on HN