

A Powerline-style prompt for Bash - milkbikis
https://github.com/milkbikis/dotfiles-mac#bash

======
davorb
The same thing for zsh <https://github.com/jeremyFreeAgent/oh-my-zsh-
powerline-theme>

------
yankcrime
Clever, but Powerline-themed context around your current shell environment
seems more suited to implementation in something like tmux - see
<https://github.com/erikw/tmux-powerline> or <http://www.drbunsen.org/text-
triumvirate.html>

------
oelmekki
I defenitely like the "make previous return status obvious" thing. Will use
that idea in my prompt, thanks.

~~~
cellularmitosis
Here's what I use: <https://gist.github.com/3686357>

It looks like this: <http://i.imgur.com/523PD.png>

~~~
oelmekki
Thanks. After reading the post, I turned my prompt into that :
<https://gist.github.com/648a75ec821acff10749>

which looks like that : <http://i.imgur.com/Qc86I.png>

I like having an uri directly pastable to scp. Also, as mentioned in other
comments, Having a fixed length prompt on the command line is quite
appreciable.

I'm unsatisfied, though, with the need of subshells to draw a single prompt.
It's ok for the git part, but I feel like the PROMPT_COMMAND part is a hack, I
just can't succeed in making it displays colors (rather than escaped
characters) without a subshell.

------
shell0x
I don't like the powerline style for displaying the path, but I like it in
tmux. It looks really awesome compared to the defaults(green background for
the status line).

------
mikeroher
Anybody else having problems getting it to work? It's just flashing for me.
I've installed a patched version of Inconsolata but still no luck.

~~~
milkbikis
Note: showing colors in terminals is done through ANSI codes which have
varying levels of compatibility with different terminals. For me, this works
on an iTerm terminal, with $TERM set to xterm-256color.

~~~
mikeroher
Yeah that was the problem. I realized that Snow Leopard's default terminal
doesn't have support for ANSI colors..I think. Anyways, if you're on Snow
Leopard or earlier versions of Mac OSX, you need to use iTerm2. Also, to make
the PS1 smaller, you can delete the two lines in the last method (the
constructor I think) that prints the hostname and user. So, delete or comment:

    
    
       p.append(' \u ', 250, 240)
       p.append(' \h ', 250, 238)

~~~
milkbikis
Yup, just remove/comment out any portions (Powerline calls it segments) you
don't like.

------
JulianWasTaken
Oh, boy, props for getting this working, but this looks really distracting to
actually use as a prompt for my tastes.

~~~
milkbikis
Yeah, I also have one that fixes the prompt to the top so you only see a small
'$' at the current line, but it messes up the terminal history.

~~~
ralph
I too prefer just PS1='$ ', I want the cursor to be the same distance from the
margin every time, to have maximum length for typing without wrapping, and the
ability to put in a few separator lines between command output by just tapping
Return.

However, for your problem, have you considered the terminal's title instead of
the top line of the tty? printf '\033]0;foo\007'

~~~
milkbikis
Hmm, that wouldn't let me keep the colors etc. I'm on iTerm btw, perhaps you
mean the title in a screen/tmux session?

~~~
ralph
No, I meant the window's furniture so no colours. I agree, a tty-wrapper, like
tmux, would provide another option. I don't suppose there are terminals
generally about where `tput hs' is true. Have you considered using the end of
the prompt line for status, returning to the left for the "$ ", and being
happy to do readline's redraw-current-line if you don't like the overwrite
should you reach that far?

------
sdfjkl
Patching my fonts seems a bit excessive just for a fancy prompt.

------
Evbn
Why are the colors broken (in ' Library') in the riced up vim?

~~~
milkbikis
That's the CtrlP vim plugin, which runs a fuzzy search. In the screenshot I'm
in the middle of a search so the matched part is partially highlighted.

------
Evbn
Powrlbe is nifty. How do I subscribe to news about new tech stuff like that? I
don't remember seeing it here.

~~~
milkbikis
I'd like to know too. Just saw it in a dotfile.

