Jump-Location icon indicating copy to clipboard operation
Jump-Location copied to clipboard

Losing jumpstat data, when working from multiply powershell windows

Open vors opened this issue 9 years ago • 11 comments

I called jumpstat sequentially and data is not consistent: it's wiped at some point. Should be a problem with DB -> file save logic

image

vors avatar Sep 26 '14 02:09 vors

Cannot repro it anymore

vors avatar Sep 26 '14 07:09 vors

Repro:

  1. Open 3 powershell windows with Jump-Location module loaded.
  2. Create folder "trololo" and cd to it
  3. Call "jumpstat trololo" many times.

Expected: Results are consistent: weight increases every time

Actual: Sometimes you get empty set.

vors avatar Sep 28 '14 00:09 vors

I'm wondering if I'm seeing the same thing. I have multiple powershell windows open all the time and my jumplist only ever contains one item (C:\users\Patrick.VanDerVelde which is my user directory from which powershell starts). I don't normally spend any time in that directory but navigate away to my GIT repo directories and stay there but they never show up. Could that be due to this issue or is it maybe another issue?

pvandervelde avatar Oct 13 '14 22:10 pvandervelde

If you don't have any PS windows open in this directory, it's probably something different. Update logic is not very robust, unfortunately. Are you using version 0.6.0? You can troubleshoot some problems with Get-Job | fl You should get background job which is responsible for call UpdateTime callback. If status of this Job is not Running, something went wrong.

vors avatar Oct 13 '14 23:10 vors

Running 0.6.0 based on my module list:

C:\Users\Patrick.VanDerVelde> Get-Module

ModuleType Version Name ExportedCommands


Binary 0.6.0.0 Jump.Location {Get-JumpStatus, Set-JumpLocation} Script 0.6.0 Jump.Location Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...} Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...} Script 0.0 posh-git {Add-SshKey, Enable-GitColors, Get-AliasPattern, Get-GitDirectory...} Script 1.0.0.12 PSReadLine {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Set-PSReadlineKeyHandler, Set-PSReadlineOpt... Binary 1.1.0.0 PSScheduledJob {Add-JobTrigger, Disable-JobTrigger, Disable-ScheduledJob, Enable-JobTrigger...} Manifest 2.0.0.0 PSWorkflow {New-PSWorkflowExecutionOption, New-PSWorkflowSession, nwsn}

Looking at the job list it seems that the job is there in one of my windows

C:\Users\Patrick.VanDerVelde> get-Job | fl

Module : __DynamicModule_3ac53c16-7d67-4e73-add2-02c45bf0a477 StatusMessage : HasMoreData : True Location : Command : [Jump.Location.SetJumpLocationCommand]::UpdateTime($($(Get-Item -Path $(Get-Location))).PSPath)

JobStateInfo : Running Finished : System.Threading.ManualResetEvent InstanceId : efb9201a-2749-4a6d-a467-0f07d2acedbe Id : 1 Name : PowerShell.OnIdle ChildJobs : {} PSBeginTime : 13/10/2014 13:58:50 PSEndTime : PSJobTypeName : Output : {} Error : {} Progress : {} Verbose : {} Debug : {} Warning : {} State : Running

In the other window I get this:

C:\vcs\git\devinfrastructure\Scripts [master +10 ~0 -0 !]> get-Job | fl

Module : __DynamicModule_79e2e61d-d974-4772-bb70-1062c2005f29 StatusMessage : HasMoreData : False Location : Command : [Jump.Location.SetJumpLocationCommand]::UpdateTime($($(Get-Item -Path $(Get-Location))).PSPath)

JobStateInfo : NotStarted Finished : System.Threading.ManualResetEvent InstanceId : fa84f162-c3d2-435e-9c5a-41e0a7bf5f31 Id : 1 Name : PowerShell.OnIdle ChildJobs : {} PSBeginTime : PSEndTime : PSJobTypeName : Output : {} Error : {} Progress : {} Verbose : {} Debug : {} Warning : {} State : NotStarted

Creating another window and running Get-Job again indicates that this last output is from the second window I started.

Shutting down all powershell windows (including ISE) and then starting a new window still doesn't start the job. Currently can't be bothered rebooting the machine to test further.

pvandervelde avatar Oct 14 '14 00:10 pvandervelde

I see similar results. In fact, if I run powershell.exe, JobStateInfo is always NotStarted. When I use powershell_ise.exe (which I usually use), Job is Running.

vors avatar Oct 14 '14 01:10 vors

Looks like it relate to interaction between Jump-Location and PSReadLine. Everything works fine, if I disable PSReadLine. @pvandervelde do you use it?

vors avatar Oct 14 '14 01:10 vors

I opened #56 to track problem with PSReadLine. @pvandervelde let me know, if it's something different for you.

vors avatar Oct 14 '14 01:10 vors

Yeah I have that module loaded as well!

pvandervelde avatar Oct 14 '14 02:10 pvandervelde

@pvandervelde as a work-around you can pre-populate jump location DB in powershell session without PSReadLine (i.e. powershell_ise.exe). Then you will be able to use it with PSReadLine, but no new info will be added.

vors avatar Oct 14 '14 03:10 vors

Same issue when I run powershell in both VSCode and Cmder. When I use jump-location in either, it wipes the stats accumulated from the other shell.

anthony-brien avatar Jan 24 '18 16:01 anthony-brien