Skip to content

Newest preexec version disables ignorespace and ignorebothΒ #1844

Closed
@cornfeedhobo

Description

@cornfeedhobo

Expected Behavior

When HISTCONTROL is set to ignorespace or ignoreboth, I expect commands with a preceding space to not be stored in history. This is a common expectation to work around situations where it's just easiest to enter a secure string as an argument to a command, and you don't want it stored in history.

Edit: before this inspires a bunch of comments about how this is bad practice, how the secrets are leaked in ps, etc; none of that is relevant. This is a behavior that the user expects to be supported and because they are unable to opt-out of our use of preexec, this should be addressed.

Current Behavior

The updated preexec library edits HISTCONTROL with the __bp_adjust_histcontrol function.

Possible Solution

  • Remove all references to this function
  • Fork and apply a working version of their PR for munging history

See rcaloras/bash-preexec#115

Steps to Reproduce

  1. set HISTCONTROL
  2. reload
  3. type command that starts with a space
  4. history 5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions