Live data from Hacker News

An adaptive prompt for Bash and Zsh

github.com

11–20 of 22 posts

Re: An adaptive prompt for Bash and Zsh

#11
post #8

Some time back I created my own ZSH prompt as I wanted something fast and minimal, where most others were too feature rich. It's also a good base if you want to create your own. https://github.com/sindresorhus/pure

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`

Re: An adaptive prompt for Bash and Zsh

#12
post #3

That is way too much information for me personally (I am distracted enough as it is, and I believe real-time data like battery level belongs in your menu bar, not the terminal) but I can see how it would be useful to some.

Yeah, Conky or similar status bar window manager widget is better for me for the real-time data (battery, cpu temp, date/time, etc.); too much to visually parse otherwise.

Definitely some nice features in here at first glance (colored directory perms and colored root vs. normal user are real nice-to-haves for example).

Re: An adaptive prompt for Bash and Zsh

#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 logically separate when needed. 

Re: An adaptive prompt for Bash and Zsh

#14
post #3

That is way too much information for me personally (I am distracted enough as it is, and I believe real-time data like battery level belongs in your menu bar, not the terminal) but I can see how it would be useful to some.

That's amusing, because I've started liquidprompt for this very specific reason: I was constantly missing the battery notification icon. Time seems to have trained my brain not to look at this screen area. Fortunately, with liquidprompt alerts are spoting just where I look at, and only when necessary.

Re: An adaptive prompt for Bash and Zsh

#15

This has nothing specific to OS X, unsure to why OS X is in the title.

To be honest, just because I've tried to pass this link in hackernews several times without success, with different combination of keywords/users.

I was a little bit shameful at the beginning, but the overwhelming success (from the perspective of this very little software: github stars * 2) is interesting.

It seems that some keywords are more efficient than others. Let's consider this practice as social engineering.

Re: An adaptive prompt for Bash and Zsh

#17
zsh has RPROMPT, which displays on the right of your prompt and gets overwritten if you write a long command. I use it to show the last command's exit status and my current git branch, effectively without taking up space.

Re: An adaptive prompt for Bash and Zsh

#18
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.)

Re: An adaptive prompt for Bash and Zsh

#19
post #8

Some time back I created my own ZSH prompt as I wanted something fast and minimal, where most others were too feature rich. It's also a good base if you want to create your own. https://github.com/sindresorhus/pure

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

Re: An adaptive prompt for Bash and Zsh

#20
A bit busy for me. I stick to time@host:dir and then a symbol for security level (root, admin, role, personal, daemon, test). Thinking about doing different color schemes for different hosts, too.
Post reply on HN