Live data from Hacker News

PS1 generator

xta.github.io

21–30 of 30 posts

Re: PS1 generator

#24
This is pretty neat. One issue: I put a lot of info in my ps1, so I need more than two space tokens. They should regenerate as you pull them up. Also, I want different colors on different tokens. I also like my git branch to be a different color between master, staging, integration (or other feature branches). I use the ps1_set from RVM, but take out the ruby version.

Re: PS1 generator

#26

Nice! I'd love to see support for the terminal window title here, too. Add an additional container for the titlebar contents, and prefix \[\e]0;$titlebar_contents\a\] to the prompt when TERM is xterm , rxvt , or screen*. Also, colors should be draggable into the prompt, since they can change between different parts of the prompt. "Last command error when not successful" is nice as well; just add this to your prompt (…

I have this bit of magic in mine to map return codes to some semblance of a string version of them:

    LED=$(perl -le "\$!+=${LE};print \$!" 2>/dev/null || echo "unknown error")
It's not perfect but I haven't found a more reliable way to map exit status' to something like the right meaning.

Re: PS1 generator

#27

If you're not opposed to using JS in your prompt (it runs fast, promise!) check out impromptu [0]. I've been using it for a few months now and it's amazing. [0]: https://github.com/impromptu/impromptu

You're probably not the maintainer, but Impromptu's README really should do a better job of explaining what it does and why I'd want to use it.

It sounds interesting, or at least I can imagine something interesting based on that description, but the only concrete information readily available seems to be that Impromptu requires Node.js and Redis. Those are fairly onerous requirements for a shell prompt, so some description of the actual features is probably warranted.

Re: PS1 generator

#29
post #23
post #6

Please add "cursor: default;" or "cursor: move;" to the draggable items. Draggable things should not use the text selection cursor. :)

Just a pull request away: https://github.com/xta/HalloweenBash/blob/master/assets/prof...

Done: https://github.com/xta/HalloweenBash/pull/12

Re: PS1 generator

#30
1. Better know what you are doing when you fiddle with your shellprompt. Nothing is more agitating than having an unresponsive prompt because you entered a larger git repository. (cough linux kernel cough)

2. Here is a color map which escape will make your prompt look which way. https://github.com/andreas-marschke/misc-tools/blob/master/s...

3. You can find my prompt setup here: https://github.com/andreas-marschke/dotfiles

It's split up across profile,bashrc,bash_alias,bash_export

4. As was requested in the comments here you can use $TERM variable to determine your terminal name. Since most popular terminal emulators try to be what they are supposed to be "dumb vt100s" you'll get xterm or (if you use a multiplexer like tmux,screen) "screen" as $TERM. IMHO its not of much use therefore.

5.https://github.com/Lokaltog/powerline << Mean to test this out. Its more for vim users.

Post reply on HN