Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Much simpler: having a colored prompt works quite well to solve the mentioned problem.

PS1="\[\033[0;31m\][\u@\h:\w]$\[\033[0m\]"



I just stuck this in my PS1:

    hr() {
        printf '=%.0s' $(seq $((${COLUMNS} - 20)))
    }

    PS1="${GREY}\d ${RED}\$(hr)${GREY} \t"
It dynamically adjusts to the width of the terminal, and looks like this:

    Mon Feb 10 ======================================== 16:30:30
My complete BASH prompt: https://bitbucket.org/wyatt/dotfiles/src/25cb260a05b68dd81a5...


Or a colored prompt with a timestamp and hostname, great with a huge scrollback.

PS1='\[\033[1;32m\](\A) <\h> [$PWD \$ \[\033[m\]'

Edit: Using tmux with a 200,000 line scrollback, you can also search scrollback based on the hour in which you ran the command. A search for "(12:" would put you right in the ball park.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: