Skip to content

Commit

Permalink
[#36] quick bashrc fix for color prompt and history time
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic-builder OSSO committed Nov 20, 2024
1 parent afd63b9 commit 710495c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ sudo LANG=C chroot $FILESYSTEM_ROOT useradd -G sudo,docker $USERNAME -c "$DEFAUL
## Create password for the default user
echo "$USERNAME:$PASSWORD" | sudo LANG=C chroot $FILESYSTEM_ROOT chpasswd

# XXXWJD/FIXME: add frr user at 300?
# XXXWJD: drop bashrc so we take the default
sudo rm $FILESYSTEM_ROOT/home/$USERNAME/.bashrc
sudo rm $FILESYSTEM_ROOT/root/.bashrc

## Create redis group
sudo LANG=C chroot $FILESYSTEM_ROOT groupadd -f redis
sudo LANG=C chroot $FILESYSTEM_ROOT usermod -aG redis $USERNAME
Expand Down
14 changes: 14 additions & 0 deletions files/image_config/bash/bash.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
HISTTIMEFORMAT='%F %T '

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
Expand All @@ -17,6 +29,8 @@ fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# XXXWJD: we like some color so separate the outut between the commands
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:$?:\[\033[01;34m\]\w\[\033[00m\]\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
Expand Down

0 comments on commit 710495c

Please sign in to comment.