Skip to content

Exclude history operations from history? #5482

Closed

Description

@mqudsi

Suggestion: exclude history search and history delete when used with additional arguments from history, as their arguments have a high chance of triggering duplication of search terms, e.g. history search foo the first time returns foo correctly, but thereafter returns both foo and history search foo.

Activity

  1. faho commented on Jan 5, 2019

    @faho
    Member

    history delete also has a high possibility of including sensitive information.

    I feel like this has a lot of overlap with #4327, because in both the idea is to provide some mechanism to not save something to history, and that it preferably not be a leading space.

    There's a few possible ideas (add a "nohist" decorator, or a special binding that doesn't add it to history, add a function that is run to determine whether something is added to history, actually add $HISTCONTROL and $HISTIGNORE), but I feel like most apply to both?

  2. j-f1 commented on Jan 5, 2019

    @j-f1

    function --no-history could be an API

  3. faho commented on Jan 5, 2019

    @faho
    Member

    function --no-history could be an API

    Or that, but

    • that gives the power to the author of the function, not the user

    • it's only for the case where you know beforehand

    • it's for one function, no matter what the arguments are - what if I want to save youtube-dl, except when used with certain sites. Or if I want to save rm, except in certain directories?

    • it's not easy to override temporarily - what if I want to save this one history delete ?

  4. mqudsi commented on Jan 5, 2019

    @mqudsi
    ContributorAuthor

    Yes, my primary motivation for this was data leaks via history delete but I purposely filed this as a separate issue from the "no history" option as I think it could be resolved on its own immediately and without too much controversy.

  5. faho commented on Jan 5, 2019

    @faho
    Member

    I think it could be resolved on its own immediately and without too much controversy.

    @mqudsi: What do you propose? Hard-coding, in C++, that we don't save history if the commandline starts with "history", or "history delete" and "history search"?

  6. mqudsi commented on Jan 6, 2019

    @mqudsi
    ContributorAuthor

    Some version of that, yes. As ugly as it sounds.

  7. zanchey commented on Jan 11, 2019

    @zanchey
    Member

    That sounds a bit too magic to me.

  8. mqudsi commented on Jan 13, 2019

    @mqudsi
    ContributorAuthor

    @zanchey on the flipside, history can be made to not emit any commands starting with history which is a lot less magic, but I think the reduced transparency in that choice makes the former suggestion more palatable.

  9. ridiculousfish commented on Jan 19, 2019

    @ridiculousfish
    Member

    I'm going to close this, this is too magic as zanchey says. It's better to be predictable.

  10. zanchey commented on Jan 21, 2019

    @zanchey
    Member

    @mqudsi, that's more palatable - it can be controlled with --include-history or similar, perhaps (though the webconfig would need something similar).

  11. locked as resolved and limited conversation to collaborators on Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions