Changing your command terminator

Top  Previous  Next

When a command is sent to the SSH server using either the SshSession.Send, SshSession.SendWait, or SshSession.SendNoWait methods it is automatically terminated with a line feed \n. Some SSH servers would prefer that commands be terminated with a carriage return line feed \r\n. To change the command terminator used when sending data change the SshSession.CommandTerminator property.

 

Example

 

[C#]

 

// set command terminator

session.CommandTerminator = "\r\n";

 

 

[VB]

 

' set command terminator

session.CommandTerminator = "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & ""