Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

Call backs depend on private members to have the same name across versions of PowerShell. Specifically fixes prompts and clear.

@PaulHigin are there other callbacks I need to fix? I noticed that ctrl+c doesn't work from PSCore6 to Windows PowerShell 5.1.

Fix #4615

Copy link
Contributor

@lzybkr lzybkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh - it's silly that the protocol requires the names of the private fields. I suppose it's just an expedient implementation detail - just use reflection, but it's so brittle.

@SteveL-MSFT
Copy link
Member Author

@lzybkr I agree now that I've learned how this aspect of the protocol works

public sealed
class ChoiceDescription
{
// DO NOT REMOVE OR RENAME THESE FIELDS - it will break remoting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the warning messages should say "it will break remoting compatibility with Windows PowerShell".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incomplete. To fully fix this incompatibility we need to revert field names for all encoded class/structs. Here is the supported list:
https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs#L41

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reused an existing comment. I can update all occurrences of that comment to be more specific. Thanks for the pointer to the list of types, I'll fix those as well.

@TravisEz13
Copy link
Member

@SteveL-MSFT One of the commits is not linked to your github account.

@SteveL-MSFT
Copy link
Member Author

@TravisEz13 fixed

public sealed
class ChoiceDescription
{
// DO NOT REMOVE OR RENAME THESE FIELDS - it will break remoting compatibility with Windows PowerShell compatibility with Windows PowerShell
Copy link
Member

@mirichmo mirichmo Nov 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about putting these fields within a region to make the grouping more explicit? The "Do Not Remove or Rename" region?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Will make an update.

@SteveL-MSFT SteveL-MSFT added this to the 6.0.0-RC milestone Nov 7, 2017
@SteveL-MSFT
Copy link
Member Author

@TravisEz13 can you merge?

@daxian-dbw daxian-dbw merged commit b194731 into PowerShell:master Nov 9, 2017
@SteveL-MSFT SteveL-MSFT deleted the remoting-callback branch November 12, 2017 05:17
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 this pull request may close these issues.

Remoting host callbacks incompatible between PowerShell 5.1 and 6.0

6 participants