denyshorman opened a new pull request, #870: URL: https://github.com/apache/mina-sshd/pull/870
### Summary This PR fixes a bug where characters were duplicated when using an interactive shell (e.g., "ping" appearing as "ppiinngg"). The fix involves removing the redundant manual echoing logic from `TtyFilterOutputStream`. ### Problem Description When using `InteractiveProcessShellFactory`, MINA SSHD starts a local process (like `/bin/sh` or `cmd.exe`) and bridges its I/O streams using `ProcessShell`. `ProcessShell` used `TtyFilterOutputStream` to wrap the process's input stream. `TtyFilterOutputStream` was configured to manually echo every character received from the client back to the client's output stream if `PtyMode.ECHO` was enabled (which is common for interactive sessions). However, interactive shells already perform their own echoing. Because `ProcessShell` operates over pipes rather than a real PTY, both the server-side filter and the shell process were echoing the input, leading to doubled characters. Standard SSH implementations (like OpenSSH) do not perform manual echoing in the server for shell sessions; they rely on the TTY or the shell process to handle it. ### Solution The manual echoing mechanism in `TtyFilterOutputStream` has been removed. 1. `PtyMode.ECHO` is no longer handled by `TtyFilterOutputStream`. 2. The `echo` parameter (a `TtyFilterInputStream`) has been removed from `TtyFilterOutputStream` constructors. 3. `ProcessShell` has been updated to stop passing the echo stream. 4. Added a test `ProcessShellTest` to verify that input is no longer redundantly echoed to the error stream. This ensures that only the underlying shell process handles echoing, which is the correct behavior for this type of shell bridging. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
