Skip to content

PowerShell.OnIdle seems not to fire in PSReadline 2.0 beta (repro) #827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
csr-nick opened this issue Dec 10, 2018 · 3 comments · Fixed by #899
Closed

PowerShell.OnIdle seems not to fire in PSReadline 2.0 beta (repro) #827

csr-nick opened this issue Dec 10, 2018 · 3 comments · Fixed by #899
Assignees

Comments

@csr-nick
Copy link

Environment data

PS version: 5.1.17134.228
PSReadline version: 2.0.0-beta3
os: 10.0.17134.1 (WinBuild.160101.0800)
PS file version: 10.0.17134.1 (WinBuild.160101.0800)

Steps to reproduce or exception report

Further to #773, I think I can repro this pretty reliably now. It seems that the OnIdle event isn't fired when another event subscriber already exists.

PS> powershell -noprofile
PS> Register-EngineEvent -SourceIdentifier PowerShell.OnIdle -Action {Write-Host '*idle*'} -MaxTriggerCount 1
PS> *idle*
PS> $timer = New-Object System.Timers.Timer -Property @{ Interval = 1000; AutoReset = $false }
PS> Register-ObjectEvent $timer Elapsed -Action { Write-Host '*timer*' } -MaxTriggerCount 1
PS> Register-EngineEvent -SourceIdentifier PowerShell.OnIdle -Action {Write-Host '*idle*'} -MaxTriggerCount 1
PS> # nothing...
PS> Get-EventSubscriber

SubscriptionId   : 3
SourceObject     : System.Timers.Timer
EventName        : Elapsed
SourceIdentifier : 6ac2a48b-3498-47af-b32b-f82652dda9f5
Action           : System.Management.Automation.PSEventJob
HandlerDelegate  :
SupportEvent     : False
ForwardEvent     : False

SubscriptionId   : 4
SourceObject     :
EventName        :
SourceIdentifier : PowerShell.OnIdle
Action           : System.Management.Automation.PSEventJob
HandlerDelegate  :
SupportEvent     : False
ForwardEvent     : False

PS> Remove-Module PSReadline
PS> *idle*
@nickcox
Copy link

nickcox commented Mar 12, 2019

Not sure if it's relevant but this also seems to affect PSReadLine on pwsh.

PS version: 6.1.3
PSReadline version: 2.0.0-beta3
os: 10.0.17134.1 (WinBuild.160101.0800)
PS file version: 6.1.3

@musm
Copy link

musm commented Apr 13, 2019

any progress on this bug?

@musm
Copy link

musm commented Apr 18, 2019

thanks, hopefully this can be pushed to a beta release soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants