ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

History poluted with some lines with numbers #505

Closed xdanielc closed 6 months ago

xdanielc commented 6 months ago

I installed the latesh version today, running the automatic script. This Happens with default "font" theme and looks something like this:

#1702347044
ls
#1702347053
cd Documentos/
#1702347057
ls
#1702347066
cd ..
#1702347068
la

My .bashrc looks like this:

# Enable the subsequent settings only in interactive sessions
case $- in
  *i*) ;;
    *) return;;
esac

# Path to your oh-my-bash installation.
export OSH='/home/dani/.oh-my-bash'

OSH_THEME="font"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.  One of the following values can
# be used to specify the timestamp format.
# * 'mm/dd/yyyy'     # mm/dd/yyyy + time
# * 'dd.mm.yyyy'     # dd.mm.yyyy + time
# * 'yyyy-mm-dd'     # yyyy-mm-dd + time
# * '[mm/dd/yyyy]'   # [mm/dd/yyyy] + [time] with colors
# * '[dd.mm.yyyy]'   # [dd.mm.yyyy] + [time] with colors
# * '[yyyy-mm-dd]'   # [yyyy-mm-dd] + [time] with colors
# If not set, the default value is 'yyyy-mm-dd'.
# HIST_STAMPS='yyyy-mm-dd'

OMB_USE_SUDO=true

completions=(
  git
  composer
  ssh
)

aliases=(
  general
)

plugins=(
  git
  bashmarks
)

source "$OSH"/oh-my-bash.sh

if [ -f ~/.mis_alias ]; then
    . ~/.mis_alias
fi
akinomyoga commented 6 months ago

That is the Bash feature to record the timestamps of the commands, which is turned off by default. Oh-My-Bash (OMB) turn on the timestamp of the Bash command history.

See Bash Reference Manual - HISTTIMEFORMAT:

HISTTIMEFORMAT

If this variable is set and not null, its value is used as a format string for strftime to print the time stamp associated with each history entry displayed by the history builtin. If this variable is set, time stamps are written to the history file so they may be preserved across shell sessions. This uses the history comment character to distinguish timestamps from other history lines.

akinomyoga commented 6 months ago

If you don't like it, you can remove the variable HISTTIMEFORMAT after sourcing oh-my-bash.sh.

# add the following line after the line "source "$OSH"/oh-my-bash.sh" in .bashrc
unset -v HISTTIMEFORMAT
xdanielc commented 6 months ago

Thanks, I didn't realize those were timestamps, don't know if adding a FAQ to the website might have help, maybe adding a link to the wiki here since it's something I overlooked, the main readme it's quite long already. I think we could close this now, leaving it to you if there's something you'd want to mention.