Live data from Hacker News

Suicide Linux

qntm.org

1–10 of 135 posts

Re: Suicide Linux

#2
Computers already demand a level of precision that is hard for biological lifeforms to conform to. Now this. Not sure if I should laugh or cry.

Re: Suicide Linux

#10
I've added a counter (of successful commands in a row) to my bashrc. I've seen it as high as 120.

  function promptCommand()
  {
    LAST_STATUS=$?
    # Set title of window to dir, then add new line to prompt.
    PS1='\[\e]0;\w\a\]\n'
    if [ $LAST_STATUS -eq 0 ]; then
      ((successes++))
      PS1+='\[\033[1;32m\][$successes]'
    else
      successes=0
      PS1+='\[\033[1;31m\][0 $LAST_STATUS]'
    fi  
    PS1+='\[\033[0;32m\] '
    PS1+='\w $(date +%H:%M) \$ \[\033[0m\]'
  }

  lastStatus=0
  successes=-1
  PROMPT_COMMAND="promptCommand"
My prompt:

  [0] /home/bar/g3 14:19 $ echo "boo"
  boo

  [1] /home/bar/g3 14:19 $
Post reply on HN