-
Notifications
You must be signed in to change notification settings - Fork 236
Make the 'PSESRemoteSessionOpenFile' a support event #652
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
Conversation
@daxian-dbw will this still work on Windows PowerShell? |
@tylerl0706 Yes, I believe so, but we surely should test it before moving forward. I would need your help to build and deploy powershell extension locally to test this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a remote machine to test with atm but I can confirm support events work fine in Windows PowerShell. Definitely a good idea.
Actually, I have a question: why don't we use the existing |
@daxian-dbw I'm not sure. Checking with @daviwil on this. |
@daxian-dbw from David: " my implementation for that came from the ISE codebase, so it's possible it was meant to be used in the ISE and never was |
I don't fully understand what a support event is, but this seems like a good change. |
I'm with Rob on this. |
It just makes it hidden by default, harder to accidentally unsubscribe it with something like |
I'm interested in hearing what @daxian-dbw has to say about I wonder if it's worth considering the removal of I could be misunderstanding. |
@PaulHigin, @daviwil mentioned that you might know something about this |
I believe the PSESRemoteSessionOpenFile event is similar to the PSISERemoteSessionOpenFile event and does the same thing. The question is why PowerShell Editor Services uses a different event and if it could just use the built-in PSISERemoteSessionOpenFile event. The PSISERemoteSessionOpenFile event implements 'psedit' function in a remote session that fires the PSISERemoteSessionOpenFile event over the remoting channel back to the host. The host (currently ISE) uses this event to copy the file from the remote target and allow users to edit it in ISE, and Save will copy the file back to the remote target. I believe PSESRemoteSessionOpenFile event does the same thing so it might make sense to update PS Editor Services to use it. Feel free to contact me offline for more information. |
ok then we can merge this in for now and then open an issue to update it to use PSISERemoteSessionOpenFile. I think we should also open an issue on PowerShell to rename/shim that (in a nice way) to something that doesn't have "ISE" in it. ... Unless @daxian-dbw would like to give it a try in this PR of course :) if not it's ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Make the
PSESRemoteSessionOpenFile
a support event, soGet-EventSubscriber
won't show up that subscriber.Get-EventSubscriber -Force
can still show the support events.Unregister-Event -Force
needs to be used to remove a support event.The event subscriber for
PSInternalRemoteDebuggerStopEvent
andPSInternalRemoteDebuggerBreakpointUpdatedEvent
are already made support events, seeServerRunspacePoolDriver.cs
.