omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Deleting Stash history

    Pythonista
    3
    4
    2884
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ihf
      ihf last edited by

      I wanted to delete my stash history and naively thought that if I cat /dev/null > .stash_history, that would do it. However, if I do that, the .stash_history file is truncated and shows 0B but when I restart stash all of the history is recreated. What I am overlooking?

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        stash probably keeps the history in memory while running, and writes it to the history file later. This means that deleting the history file from stash does not clear the history, because the copy in memory is not cleared. To clear the history you can probably run something like import os; os.remove(os.path.expanduser("~/Documents/.stash_history")) in the Python prompt (while stash is not running). I don't remember where exactly the .stash_history file is located, so you may need to adjust the path.

        1 Reply Last reply Reply Quote 2
        • ywangd
          ywangd last edited by

          @ihf
          @dgelessus is right. StaSh keeps all history in memory while running and write them to the history file when it quits.

          The history file is by default located under stash installation root, i.e. ~/Documents/site-packages/stash/.stash_history

          To delete the history, maybe you can try this:
          After you truncating the history file, try manually restart pythonista while stash is still running, i.e. double click home and swipe pythonista out of the task list. That will most likely end stash without it performing any tasks on exit.

          1 Reply Last reply Reply Quote 0
          • ihf
            ihf last edited by

            @ywangd Unfortunately, manually restarting Pythonista does not do the trick.
            @dgelessus That worked.

            Thank you.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors