elementary / elementary/triage

Bash history always resets back to default value.

Open
#77 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## What Happened

My .bash_history files are resets back to default value and erase all other history. It happens time to time. I have no idea what is triggering this reset. This 3 lines are only thing I add for my `.bashrc` to have infinite history.
```
HISTSIZE=-1
HISTFILESIZE=-1
HISTIGNORE="ls:ll:bg:fg:history:htop"
```

Only way I can avoid this reset situation is to change history file name with `HISTFILE` env.
```
HISTFILE=~/.bash_history-infinite
```

**Note**: _This was not new. I had this issue on elementary 5 too._

## Expected Behavior

According to bash documents, adding `HISTSIZE=-1` & `HISTFILESIZE=-1` to my `.bashrc` is makes it infitite history.
```man
HISTSIZE
The number of commands to remember in the command history (see HISTORY below). If the value is 0,
commands are not saved in the history list. Numeric values less than zero result in every command
being saved on the history list (there is no limit). The shell sets the default value to 500 after
reading any startup files.
HISTFILESIZE
The maximum number of lines contained in the history file. When this variable is assigned a value,
the history file is truncated, if necessary, to contain no more than that number of lines by remov‐
ing the oldest entries. The history file is also truncated to this size after writing it when a
shell exits. If the value is 0, the history file is truncated to zero size. Non-numeric values
and numeric values less than zero inhibit truncation. The shell sets the default value to the
value of HISTSIZE after reading any startup files.
```

## Steps to Reproduce

1. Add `HISTSIZE=-1` & `HISTFILESIZE=-1` to `.bashrc`
2. Use it for a while. Like few days
3. Check if it's reverts back to default value and erase history

### Logs

None

## Platform Information

elementary OS 6
elementary OS 5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.