tmux-python/tmuxp

Document conditions for `suppress_history` variable

jpcirrus opened this issue · 5 comments

Step 1: Provide a summary of your problem

The documentation, as at 2022-08-28, for the suppress_history configuration variable does not mention that this functionality depends on the shell being appropriately configured (e.g. bash requires the shell variable HISTCONTROL to be set and include either of the values ignorespace or ignoreboth [to also ignore sequential duplicate commands], and zsh requires setopt HIST_IGNORE_SPACE). If these prerequisites are not met, regardless of the value of suppress_history, shell_command will be appended to shell history.

tony commented

@jpcirrus That's a good point

What do you propose? If this is really up to individual shell's configuration, it looks like our documentation would need to be updated to make this reflect the reality of the situation

I would suggest adding a sentence to the Terminal History section of the documentation along the lines of:

The suppression of the shell_command commands from the shell's history occurs by prefixing the commands with a space when suppress_history: true. Accordingly, this functionality depends on the shell being appropriately configured: bash requires the shell variable HISTCONTROL to be set and include either of the values ignorespace or ignoreboth (to also ignore sequential duplicate commands), and zsh requires setopt HIST_IGNORE_SPACE.

tony commented

@jpcirrus I will look into this closer.

tony commented

@jpcirrus Would you like to make a PR for this - since you wrote that? (so you get credit?)

Done in #817