[IPython-User] customizing history logging

Yaroslav Bulatov yaroslavvb@gmail....
Fri Sep 14 18:21:12 CDT 2012


Does anyone know how I could customize history logging for shell
commands in IPython?

Right now my bash logs history using customized $PROMPT and want to
capture the same information in IPython

  local vals=(
    "${1}"  # the event type
    "$( readlink /proc/$$/fd/0 )"  # the current TTY
    "${$}"  # session PID
    "${SUDO_USER:-${USER}}"  # the current user
    "${HOSTNAME}"
    "${PWD}"
    "${2}"  # the rval of the command
    "'$( date --date "1970-01-01 ${cmd_start} sec UTC" "+${BAH_DATE_FMT}" )'"
    "$(( $( date '+%s' ) - cmd_start ))"  # command duration
    "${cmd_no}"
    "'${cmd}'"
    "${PPID}"
    "${EMACS}"
    "${WINDOWID}"
    "${SSH_CLIENT}"
    "${SSH_CONNECTION}"
    "${SSH_TTY}"
  )

Also, is it possible to change the special shell key "!" to something
else? I'm looking to remap is to something easily reachable by right
hand, like =


More information about the IPython-User mailing list