Bash-it / bash-it

A community Bash framework.
MIT License
14.14k stars 2.29k forks source link

[Bug]: .bash_it/lib/history.bash reuses HISTCONTROL for it's own incorrect purposes by default #2232

Closed kmcfate closed 7 months ago

kmcfate commented 7 months ago

Expected behavior

mcfly (a bash history replacement) should properly record and recall commands

Current behavior

mcfly does not properly record or recall commands

Possible solution

Setting HISTCONTROL to 'noauto' fixes the problem, but ignore the fact this is an invalid value for HISTCONTROL. Do not enable .bash_it/lib/history.bash contents by default, or specifically do not run history -a by default as histappend is enabled by default. There is a whole plugin dedicated to bash history, why does this library even exist?

Context

It breaks mcfly

Steps to reproduce

Install mcfly and try to use it.

Bash-it version

https://github.com/Bash-it/bash-it/commit/36708d7

List of enabled plugins, themes and aliases

N/A

Bash version

5.2.15

Operating system and version

Ubuntu 22.04

bash-it doctor output

# How to get: bash-it doctor

Your ~/.bashrc

# How to get: cat ~/.bashrc

Notes

No response

cornfeedhobo commented 7 months ago

I would like to see more reasoning than mcfly. We have users that have used this for too many years to leap to this conclusion to accommodate a new tool. I'm still open to reviewing this topic, but I'm sensitive to how central this is to many people's environments and how stable it's been over time.

kmcfate commented 7 months ago

I've been using mcfly and bash-it for years before this change was introduced. Pulling a recent version broke me. Please see my comments on the PR.

kmcfate commented 7 months ago

Workaround is adding 'noauto' to HISTCONTROL.