![]() However, I'd really like something like history -c from bash, which is much more elegant than having to close and restart the terminal. This causes the history of the closed session not be appended to $HISTFILE. There is a workaround I use for now, but it's obviously less than ideal: in the current session I set HISTFILE=/dev/null and just close and reopen the terminal. ![]() Deleting the contents of $HISTFILE does the opposite of what I want: it deletes the history I want to preserve and preserves the history I want to delete (since current session's history would get appended to it, regardless if its contents was previously erased). Just to clarify, I'm not looking for a way to delete the contents of $HISTFILE, I just want a command to reset the history to the same state it was in when I opened the terminal. To create a script to clear the RAM, proceed as follows: Create a new text document by right-clicking on your desktop and selecting new and text document in the pop-up menu: Instead of the standard Windows editor you can also use any other text editor to create the macro. In zsh history -c returns 1 with an error message history: bad option: -c. ![]() I'm looking for the zsh equivalent of the bash command history -c, in other words, clear the history for the current session.
0 Comments
Leave a Reply. |