Live data from Hacker News

Bash PS1 Generator

bashrcgenerator.com

41–50 of 146 posts

Re: Bash PS1 Generator

#42
post #36

I think the drag-n-drop UI is less intuitive. Wasted a few minutes trying to click these items as "buttons" and wondering if there's something wrong because of the http-onlyness of the site (console gives a lot of warning).

Yea, why not just have "double-click" as "add this element to the end of input".

does it work on mobile? I couldn't get it to. By coincidence I need to update PS1 on a bunch of servers today, nice idea.

Exit status should defo be in the default in all distros.

Re: Bash PS1 Generator

#43
post #31
post #14

Notes: * As an idea, this is excellent. It's intuitive to use and provides full instructions on how to implement * Putting an element in any other position than the end of the prompt is fiddly. * I'd love for the option to to be able to colour elements. * More advanced or exotic element types such as Git Branch would be excellent (Not sure if Bash supports this, but I've seen it in some shells)

For the manual approach, git provides a shell script to generate the env var __git_ps1 for this very purpose.[1] [1]: https://git-scm.com/book/id/v2/Appendix-A%3A-Git-in-Other-En...

I think a manual approach is covered with vim ;)

Re: Bash PS1 Generator

#44

Normally I don't post much about how a site should use HTTPS on HN, but for this specific instance I think it's important.

why?

I assume they are saying that because you wouldn't want something where someone could do a MITM and insert arbitrary bash commands through $() or other similar things

Re: Bash PS1 Generator

#45
Somewhat related to PS1 is PS4 in bash.

Make your trace output more useful/verbose in your scripts:

  set -x
  export PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}:   '
This will print the filename, function name, line number, and line content during execution.

Re: Bash PS1 Generator

#48
Was expecting this:

   ________________
  |   |,"    `.|   | SgH
  |   /  SONY  \   |
  |O _\   />   /_  |   ___ _
  |_(_)'.____.'(_)_|  (")__(")
  [___|[=]__[=]|___]  //    \\

Re: Bash PS1 Generator

#49
post #36

I think the drag-n-drop UI is less intuitive. Wasted a few minutes trying to click these items as "buttons" and wondering if there's something wrong because of the http-onlyness of the site (console gives a lot of warning).

Thank you for that. I've been clicking and thought it was broken.
Post reply on HN