Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 994
Feature/change window size request for ssh client#1062
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6452fda485adffa5d7b01ec60725f77df6a61d5324File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,6 +7,8 @@ | ||
| using System.Threading; | ||
| using System.Text.RegularExpressions; | ||
| using Renci.SshNet.Abstractions; | ||
| using System.CodeDom; | ||
| using System.Runtime.InteropServices; | ||
| namespace Renci.SshNet | ||
| { | ||
| @@ -52,6 +54,19 @@ public bool DataAvailable | ||
| } | ||
| } | ||
| } | ||
| /// <summary> | ||
| /// Sends a Window Change Request via the Channel. | ||
| /// </summary> | ||
| /// <param name="columns">New screen width in # of columns</param> | ||
| /// <param name="rows">New screen height in # of rows</param> | ||
| /// <param name="width">New screen width in Pixels</param> | ||
| /// <param name="height">New screen height in Pixels</param> | ||
| /// <returns>true when change is successful, or false when channel is NOT open or the request </returns> | ||
| public bool ChangeWindow(uint columns, uint rows, uint width, uint height ) | ||
| { | ||
| if (_channel==null || !_channel.IsOpen) return false; | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please have it throw an ObjectDisposedException when _channel is null, and an InvalidOperationException if the channel is closed. Please document this as such and add corresponding unit tests. I would've prefered to have the method on ChannelSession also throw if the channel were closed, but that would be considered a breaking change. That method currently either throws or returns true, never false. It also returns true if the channel is closed 😌
| ||
| return _channel.SendWindowChangeRequest(columns, rows, width, height); | ||
| } | ||
| /// <summary> | ||
| /// Gets the number of bytes that will be written to the internal buffer. | ||
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.
Not very useful since
SendWindowChangeRequest(...)always returns true, but let's discuss.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.
Hmm, I dont think SendWindowChangeRequest SHOULD always be true. For example a change to size of 0,0,0,0 should fail and probably will on some pty implementations.