mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 12:05:21 +02:00
[204744] Honor encoding in SSH command input field
This commit is contained in:
parent
53be336cfa
commit
441b38a6da
1 changed files with 14 additions and 8 deletions
|
@ -15,6 +15,7 @@
|
||||||
* Martin Oberhuber (Wind River) - Adapted from LocalHostShell.
|
* Martin Oberhuber (Wind River) - Adapted from LocalHostShell.
|
||||||
* David McKnight (IBM) - [191599] Use the remote encoding specified in the host property page
|
* David McKnight (IBM) - [191599] Use the remote encoding specified in the host property page
|
||||||
* David McKnight (IBM) - [196301] Check that the remote encoding isn't null before using it
|
* David McKnight (IBM) - [196301] Check that the remote encoding isn't null before using it
|
||||||
|
* Martin Oberhuber (Wind River) - [204744] Honor encoding in SSH command input field
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.services.ssh.shell;
|
package org.eclipse.rse.internal.services.ssh.shell;
|
||||||
|
@ -22,7 +23,9 @@ package org.eclipse.rse.internal.services.ssh.shell;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
@ -64,7 +67,7 @@ public class SshHostShell extends AbstractHostShell implements IHostShell {
|
||||||
// ((ChannelShell)fChannel).setPty(false);
|
// ((ChannelShell)fChannel).setPty(false);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//Try to set the user envionment. On most sshd configurations, this will
|
//Try to set the user environment. On most sshd configurations, this will
|
||||||
//not work since in sshd_config, PermitUserEnvironment and AcceptEnv
|
//not work since in sshd_config, PermitUserEnvironment and AcceptEnv
|
||||||
//settings are disabled. Still, it's worth a try.
|
//settings are disabled. Still, it's worth a try.
|
||||||
if (environment!=null && environment.length>0 && fChannel instanceof ChannelShell) {
|
if (environment!=null && environment.length>0 && fChannel instanceof ChannelShell) {
|
||||||
|
@ -92,13 +95,16 @@ public class SshHostShell extends AbstractHostShell implements IHostShell {
|
||||||
}
|
}
|
||||||
fStderrHandler = new SshShellOutputReader(this, null,true);
|
fStderrHandler = new SshShellOutputReader(this, null,true);
|
||||||
OutputStream outputStream = fChannel.getOutputStream();
|
OutputStream outputStream = fChannel.getOutputStream();
|
||||||
//TODO check if encoding or command to execute needs to be considered
|
if (encoding!=null) {
|
||||||
//If a command is given, it might be possible to do without a Thread
|
//use specified encoding
|
||||||
//Charset cs = Charset.forName(encoding);
|
Charset cs = Charset.forName(encoding);
|
||||||
//PrintWriter outputWriter = new PrintWriter(
|
PrintWriter outputWriter = new PrintWriter(
|
||||||
// new BufferedWriter(new OutputStreamWriter(outputStream,cs)));
|
new OutputStreamWriter(outputStream,cs));
|
||||||
PrintWriter outputWriter = new PrintWriter(outputStream);
|
fShellWriter = new SshShellWriterThread(outputWriter);
|
||||||
fShellWriter = new SshShellWriterThread(outputWriter);
|
} else {
|
||||||
|
PrintWriter outputWriter = new PrintWriter(outputStream);
|
||||||
|
fShellWriter = new SshShellWriterThread(outputWriter);
|
||||||
|
}
|
||||||
fChannel.connect();
|
fChannel.connect();
|
||||||
if (initialWorkingDirectory!=null && initialWorkingDirectory.length()>0
|
if (initialWorkingDirectory!=null && initialWorkingDirectory.length()>0
|
||||||
&& !initialWorkingDirectory.equals(".") //$NON-NLS-1$
|
&& !initialWorkingDirectory.equals(".") //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue