-
-
Notifications
You must be signed in to change notification settings - Fork 940
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
Support creating shell without PTY #1418
Comments
To support creating shell without PTY, we can add a new constructor for |
scott-xu
added a commit
to scott-xu/SSH.NET
that referenced
this issue
May 30, 2024
SSHJ does have a dedicate allocatePTY method. void allocatePTY(String term, int cols, int rows, int width, int height, Map<PTYMode, Integer> modes)
throws ConnectionException, TransportException; try {
ssh.addHostKeyVerifier(new PromiscuousVerifier());
// Set interval to enable keep-alive before connecting
ssh.getConnection().getKeepAlive().setKeepAliveInterval(5);
ssh.connect(args[0]);
ssh.authPassword(args[1], args[2]);
Session session = ssh.startSession();
session.allocateDefaultPTY();
new CountDownLatch(1).await();
try {
session.allocateDefaultPTY();
} finally {
session.close();
}
} finally {
ssh.disconnect();
} |
sendevman
pushed a commit
to sendevman/SSH.NET
that referenced
this issue
Sep 1, 2024
* Support creating Shell(Stream) without PTY Fixes sshnet/SSH.NET#1418 * Add integration test for "PermitTTY no" * Fix Integration Test * Remove duplicate shell request * Put common operations in a shared constructor. Update xml doc comments. * Update comments and method overriding * Update per code review * Update integration tests * Renaming * Make `bufferSize` optional * Try fix the test * Update per code review * try agian * try again * docs * doc --------- Co-authored-by: Rob Hague <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OpenSSH client supports
-T
option to disable pseudo-terminal allocation. Can we add this feature to SSH.NET as well?With this option, the output from remote does not contain control sequences.
It is not user-friendly but program-friendly. Program at client side does not need to parse/draw the screen with control sequences to get the correct output.
There's already
SshCommand
feature which is similar with this. ButSshCommand
does not support interactions.SshCommand
runs and ends.https://www.man7.org/linux/man-pages/man1/ssh.1.html
-T Disable pseudo-terminal allocation.
The text was updated successfully, but these errors were encountered: