Skip to content

Instantly share code, notes, and snippets.

@FernandoBasso FernandoBasso/bashrc
Last active Aug 29, 2015

Embed
What would you like to do?
List all categories, and all the posts in each category.
unset HISTFILESIZE
HISTSIZE=2000
PROMPT_COMMAND="${PROMPT_COMMAND:-:}; history -a"
export HISTSIZE PROMPT_COMMAND
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
#PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#PROMPT_COMMAND='echo -ne "\033]0; ${PWD}\007"'
# Show the currently running command in the terminal title:
# http://www.davidpashley.com/articles/xterm-titles-with-bash.html
show_command_in_title_bar()
{
case "$BASH_COMMAND" in
*\033]0*)
# The command is trying to set the title bar as well;
# this is most likely the execution of $PROMPT_COMMAND.
# In any case nested escapes confuse the terminal, so don't
# output them.
;;
*)
#echo -ne "\033]0;${USER}@${HOSTNAME}: ${BASH_COMMAND}\007"
echo -ne "\033]0; ${BASH_COMMAND}\007"
;;
esac
}
trap show_command_in_title_bar DEBUG
;;
*)
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.