From 42b358862feda70316ef9e354a9c29d7cceba1f2 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 21 Jul 2026 15:16:54 -0600 Subject: [PATCH] feat: add DisableEcho property to GenericSshClient and integrate with CommFactory --- src/PepperDash.Core/Comm/GenericSshClient.cs | 16 +++++++++++++++- .../Comm and IR/CommFactory.cs | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/PepperDash.Core/Comm/GenericSshClient.cs b/src/PepperDash.Core/Comm/GenericSshClient.cs index 1ab382fd..471d8a2c 100644 --- a/src/PepperDash.Core/Comm/GenericSshClient.cs +++ b/src/PepperDash.Core/Comm/GenericSshClient.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Text; using System.Timers; using Crestron.SimplSharp; @@ -137,6 +138,11 @@ public class GenericSshClient : Device, ISocketStatusWithStreamDebugging, IAutoR private bool DisconnectLogged = false; + /// + /// When true, turns off echo for the SSH session + /// + public bool DisableEcho { get; set; } + /// /// Typical constructor. /// @@ -250,7 +256,15 @@ public class GenericSshClient : Device, ISocketStatusWithStreamDebugging, IAutoR try { Client.Connect(); - TheStream = Client.CreateShellStream("PDTShell", 0, 0, 0, 0, 65534); + + var modes = new Dictionary(); + + if (DisableEcho) + { + modes.Add(TerminalModes.ECHO, 0); + } + + TheStream = Client.CreateShellStream("PDTShell", 0, 0, 0, 0, 65534, modes); if (TheStream.DataAvailable) { // empty the buffer if there is data diff --git a/src/PepperDash.Essentials.Core/Comm and IR/CommFactory.cs b/src/PepperDash.Essentials.Core/Comm and IR/CommFactory.cs index 82c5ce6c..3ba5300c 100644 --- a/src/PepperDash.Essentials.Core/Comm and IR/CommFactory.cs +++ b/src/PepperDash.Essentials.Core/Comm and IR/CommFactory.cs @@ -68,6 +68,7 @@ namespace PepperDash.Essentials.Core; { var ssh = new GenericSshClient(deviceConfig.Key + "-ssh", c.Address, c.Port, c.Username, c.Password); ssh.AutoReconnect = c.AutoReconnect; + ssh.DisableEcho = c.DisableSshEcho; if(ssh.AutoReconnect) ssh.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs; comm = ssh;