badmotorfinger / z

Save time typing out directory paths in PowerShell by jumping around instead.
The Unlicense
430 stars 33 forks source link

Save on exit #25

Closed punassuming closed 8 years ago

punassuming commented 8 years ago

Only save directory listing on exit.

I have profiled the script and a large portion of the time when performing a cdX is saving the cdHistory. This will save the file on exit with a hook.

badmotorfinger commented 8 years ago

Hi there!

Thanks for the commit and pull request. The problem with hooking into the exit event is that it's only fired if the user clicks the "X" button. Exiting from the command prompt using the "exit" command will exit without the event firing. This means your history changes could be excluded altogether.

How big exactly is your history file which is slowing it down that much?

badmotorfinger commented 8 years ago

Just thinking about this, perhaps it should be configurable.

punassuming commented 7 years ago

@vincpa, I just found there is a handler for using exit as well, would you be interested in this option if both handlers were used?

badmotorfinger commented 7 years ago

Absolutely. Losing my history at the start of each session is painful.