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

Great post! I use screen a lot, and always miss having the other terminal histories readily available.

However, reversing PROMPT_COMMAND so that "history -a" comes first makes more sense: this way the last command executed on the current terminal has a better chance of being on top of the list for the next up-arrow (which more closely resembles usual behavior).

Also, as noted above, it's better to append to PROMPT_COMMAND rather than just overwriting it. Thus, my .bashrc now reads:

  export PROMPT_COMMAND="history -a; history -n;${PROMPT_COMMAND}"


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

Search: