From 7b1c8173e743c01a63ffad5fec394c7e3a52baf2 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Fri, 11 Dec 2020 18:22:00 +0200 Subject: [PATCH] bash: better default bashrc --- packages/bash/etc-bash.bashrc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/bash/etc-bash.bashrc b/packages/bash/etc-bash.bashrc index a36948a25..a9224bb47 100644 --- a/packages/bash/etc-bash.bashrc +++ b/packages/bash/etc-bash.bashrc @@ -1,7 +1,24 @@ +# Command history tweaks: +# - Append history instead of overwriting +# when shell exits. +# - When using history substitution, do not +# exec command immediately. +# - Do not save to history commands starting +# with space. +# - Do not save duplicated commands. +shopt -s histappend +shopt -s histverify +export HISTCONTROL="ignoreboth" + +# Default command line prompt. +PROMPT_DIRTRIM=2 +PS1="\\[\\e[0;32m\\]\\w\\[\\e[0m\\] \\[\\e[0;97m\\]\\$\\[\\e[0m\\] " + +# Handles nonexistent commands. +# If user has entered command which invokes non-available +# utility, command-not-found will give a package suggestions. if [ -x @TERMUX_PREFIX@/libexec/termux/command-not-found ]; then command_not_found_handle() { @TERMUX_PREFIX@/libexec/termux/command-not-found "$1" } fi - -PS1='\$ '