A seemingly new feature in OS X El Capitan (10.11 Beta) is Bash sessions (Terminal sessions). I now have a ~/.bash_sessions
directory with history files, and my HISTFILE
and HISTIGNORE
envars are being overridden. How can I disable all of this functionality?
You can disable the per-terminal-session command history feature by setting SHELL_SESSION_HISTORY=0 in your ~/. bashrc script, as described here: You may disable this behavior and share a single history by setting SHELL_SESSION_HISTORY to 0.
Otherwise, you can press Esc (or Command-period on a Mac) to abort the script. If you have FMA you can open the Script Debugger. First time you open it the script should stop on the current step.
since there's currently no way to disable the message but keeping the functionality, executing clear command on the terminal startup is my current workaround. for powershell, just add clear command to the profile. Save this answer.
Mac OS X comes with the Bourne Again SHell (bash) as the default user shell and also includes the TENEX C shell (tcsh), the Korn shell (ksh), and the Z shell (zsh). bash, ksh, and zsh are compatible with sh, the original Bourne shell.
sudo stands for superuser do. You're asked for the password of the current user. You're asked to enter the password for adminUsername, after which a new shell is opened for that user. If a command requires it, you can use su to switch to the root user.
If you startup a new Bash session manually (i.e. bash -xl
), you can see what is run on login.
You'll see the following line in the output:
.... +++ '[' '!' -e /Users/username/.bash_sessions_disable ']'
You can create a .bash_sessions_disable
file in your home directory to disable this functionality.
This behavior is defined in /etc/bashrc_Apple_Terminal
. It contains documentation comments describing what it does and how to customize it.
You can disable the per-terminal-session command history feature by setting SHELL_SESSION_HISTORY=0
in your ~/.bashrc
script, as described here:
You may disable this behavior and share a single history by setting SHELL_SESSION_HISTORY to 0. There are some common user customizations that arrange to share new commands among running shells by manipulating the history at each prompt, and they typically include 'shopt -s histappend'; therefore, if the histappend shell option is enabled, per-session history is disabled by default. You may explicitly enable it by setting SHELL_SESSION_HISTORY to 1.
Note that, although you can disable the entire session-state restoration mechanism by creating ~/.bash_sessions_disable
, this is unnecessary just to disable the per-session command history feature, and is not recommended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With