Skip to content

Not able to send Window Change Request from ShellStream #1061

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

Open
glenkleidon opened this issue Dec 11, 2022 · 2 comments
Open

Not able to send Window Change Request from ShellStream #1061

glenkleidon opened this issue Dec 11, 2022 · 2 comments
Milestone

Comments

@glenkleidon
Copy link

glenkleidon commented Dec 11, 2022

After opening a SshClient Connection (calling CreateShell) there is no way to call SendWindowChangeRequest because _channel (IChannelSession) is an internal field and not accessible.

The solution appears to be surfacing the SendWindowChangeRequest in the ShellStream class. I note other requests like ChangeFlow etc. would remain inaccessible though.

The alternative is to surface the IChannelSession interface and make it a read only property to get references to all the underlying methods. But that is 2 levels of abstraction more primitive than the client - so implementing a method "WindowChangeRequest" thats calls the IChannelSession.SendWindowChangeRequest method is most obvious, but that would suggest implementing a wrapper to all the other methods: SendPseudoTerminalRequest, SendX11ForwardingRequest - ie practically the whole IChannel Interface.

So I recommend surfacing the IChannelSession as a read only property.

@glenkleidon
Copy link
Author

It turns out IChannelSession is defined as internal. So back to the other solution.
I do see that Client.ConnectionInfo.SupportedRequests can return the supported Requests.

glenkleidon pushed a commit to glenkleidon/SSH.NET that referenced this issue Dec 11, 2022
glenkleidon pushed a commit to glenkleidon/SSH.NET that referenced this issue Dec 11, 2022
glenkleidon pushed a commit to glenkleidon/SSH.NET that referenced this issue Dec 11, 2022
@glenkleidon
Copy link
Author

I wonder why the IChannelSession is not public?

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

No branches or pull requests

2 participants