Browse Source

Added more information for the terminalName argument of CreateShellStream.
Fixes issue #10.
Removed bufferSize from the ShellStream ctor.

drieseng 9 years ago
parent
commit
14e26081af

+ 19 - 9
src/Renci.SshNet/Messages/Connection/ChannelRequest/PseudoTerminalInfo.cs

@@ -25,10 +25,10 @@ namespace Renci.SshNet.Messages.Connection
         }
 
         /// <summary>
-        /// Gets or sets the environment variable (e.g., vt100).
+        /// Gets or sets the value of the TERM environment variable (e.g., vt100).
         /// </summary>
         /// <value>
-        /// The environment variable.
+        /// The value of the TERM environment variable.
         /// </value>
         public string EnvironmentVariable { get; set; }
 
@@ -95,12 +95,22 @@ namespace Renci.SshNet.Messages.Connection
         /// <summary>
         /// Initializes a new instance of the <see cref="PseudoTerminalRequestInfo"/> class.
         /// </summary>
-        /// <param name="environmentVariable">The environment variable.</param>
-        /// <param name="columns">The columns.</param>
-        /// <param name="rows">The rows.</param>
-        /// <param name="width">The width.</param>
-        /// <param name="height">The height.</param>
+        /// <param name="environmentVariable">The <c>TERM</c> environment variable which a identifier for the text window’s capabilities.</param>
+        /// <param name="columns">The terminal width in columns.</param>
+        /// <param name="rows">The terminal width in rows.</param>
+        /// <param name="width">The terminal height in pixels.</param>
+        /// <param name="height">The terminal height in pixels.</param>
         /// <param name="terminalModeValues">The terminal mode values.</param>
+        /// <remarks>
+        /// <para>
+        /// The <c>TERM</c> environment variable contains an identifier for the text window's capabilities.
+        /// You can get a detailed list of these cababilities by using the ‘infocmp’ command.
+        /// </para>
+        /// <para>
+        /// The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer
+        /// to the drawable area of the window.
+        /// </para>
+        /// </remarks>
         public PseudoTerminalRequestInfo(string environmentVariable, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModeValues)
             : this()
         {
@@ -127,11 +137,11 @@ namespace Renci.SshNet.Messages.Connection
 
             if (TerminalModeValues != null)
             {
-                Write((uint)TerminalModeValues.Count * (1 + 4) + 1);
+                Write((uint) TerminalModeValues.Count*(1 + 4) + 1);
 
                 foreach (var item in TerminalModeValues)
                 {
-                    Write((byte)item.Key);
+                    Write((byte) item.Key);
                     Write(item.Value);
                 }
                 Write((byte)0);

+ 1 - 1
src/Renci.SshNet/ShellStream.cs

@@ -54,7 +54,7 @@ namespace Renci.SshNet
             }
         }
 
-        internal ShellStream(ISession session, string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize, IDictionary<TerminalModes, uint> terminalModeValues)
+        internal ShellStream(ISession session, string terminalName, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModeValues)
         {
             _encoding = session.ConnectionInfo.Encoding;
             _session = session;

+ 33 - 13
src/Renci.SshNet/SshClient.cs

@@ -406,16 +406,26 @@ namespace Renci.SshNet
         /// <summary>
         /// Creates the shell stream.
         /// </summary>
-        /// <param name="terminalName">Name of the terminal.</param>
-        /// <param name="columns">The columns.</param>
-        /// <param name="rows">The rows.</param>
-        /// <param name="width">The width.</param>
-        /// <param name="height">The height.</param>
+        /// <param name="terminalName">The <c>TERM</c> environment variable.</param>
+        /// <param name="columns">The terminal width in columns.</param>
+        /// <param name="rows">The terminal width in rows.</param>
+        /// <param name="width">The terminal height in pixels.</param>
+        /// <param name="height">The terminal height in pixels.</param>
         /// <param name="bufferSize">Size of the buffer.</param>
         /// <returns>
-        /// Reference to Created ShellStream object.
+        /// The created <see cref="ShellStream"/> instance.
         /// </returns>
         /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <remarks>
+        /// <para>
+        /// The <c>TERM</c> environment variable contains an identifier for the text window's capabilities.
+        /// You can get a detailed list of these cababilities by using the ‘infocmp’ command.
+        /// </para>
+        /// <para>
+        /// The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer
+        /// to the drawable area of the window.
+        /// </para>
+        /// </remarks>
         public ShellStream CreateShellStream(string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize)
         {
             return CreateShellStream(terminalName, columns, rows, width, height, bufferSize, null);
@@ -424,22 +434,32 @@ namespace Renci.SshNet
         /// <summary>
         /// Creates the shell stream.
         /// </summary>
-        /// <param name="terminalName">Name of the terminal.</param>
-        /// <param name="columns">The columns.</param>
-        /// <param name="rows">The rows.</param>
-        /// <param name="width">The width.</param>
-        /// <param name="height">The height.</param>
+        /// <param name="terminalName">The <c>TERM</c> environment variable.</param>
+        /// <param name="columns">The terminal width in columns.</param>
+        /// <param name="rows">The terminal width in rows.</param>
+        /// <param name="width">The terminal height in pixels.</param>
+        /// <param name="height">The terminal height in pixels.</param>
         /// <param name="bufferSize">Size of the buffer.</param>
         /// <param name="terminalModeValues">The terminal mode values.</param>
         /// <returns>
-        /// Reference to Created ShellStream object.
+        /// The created <see cref="ShellStream"/> instance.
         /// </returns>
         /// <exception cref="SshConnectionException">Client is not connected.</exception>
+        /// <remarks>
+        /// <para>
+        /// The <c>TERM</c> environment variable contains an identifier for the text window's capabilities.
+        /// You can get a detailed list of these cababilities by using the ‘infocmp’ command.
+        /// </para>
+        /// <para>
+        /// The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer
+        /// to the drawable area of the window.
+        /// </para>
+        /// </remarks>
         public ShellStream CreateShellStream(string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize, IDictionary<TerminalModes, uint> terminalModeValues)
         {
             EnsureSessionIsOpen();
 
-            return new ShellStream(Session, terminalName, columns, rows, width, height, bufferSize, terminalModeValues);
+            return new ShellStream(Session, terminalName, columns, rows, width, height, terminalModeValues);
         }
 
         /// <summary>