diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java index 7b72a87de16..a08c0c4f6cf 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java @@ -74,7 +74,6 @@ public class CommandMinerThread extends MinerThread private boolean _isDone; private boolean _isWindows; private boolean _isTTY; - private boolean _isOS400 = false; private boolean _didInitialCWDQuery = false; private CommandMiner.CommandMinerDescriptors _descriptors; @@ -100,13 +99,6 @@ public class CommandMinerThread extends MinerThread _patterns.refresh(_invocation); - - - if (theOS.toLowerCase().startsWith("os/400")) //$NON-NLS-1$ - { - _isOS400 = true; - } - if (theOS.toLowerCase().startsWith("z")) //$NON-NLS-1$ { System.setProperty("dstore.stdin.encoding","Cp037"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -153,7 +145,7 @@ public class CommandMinerThread extends MinerThread { _isTTY = false; } - _patterns.setIsTerminal(_isTTY && !_isOS400); + _patterns.setIsTerminal(_isTTY); String property = "SHELL="; //$NON-NLS-1$ @@ -169,10 +161,6 @@ public class CommandMinerThread extends MinerThread theShell = "sh"; //$NON-NLS-1$ } } - if (_isOS400) - { - theShell = "/QOpenSys/usr/bin/sh";//var.substring(property.length(), var.length()); //$NON-NLS-1$ - } } @@ -237,12 +225,6 @@ public class CommandMinerThread extends MinerThread args[1] = theShell; args[2] = "-c"; //$NON-NLS-1$ args[3] = _invocation; - /* - for (int i = 0; i < inv.length; i++) - { - args[3 + i] = inv[i]; - } - */ _theProcess = Runtime.getRuntime().exec(args, env, theDirectory); } @@ -253,12 +235,7 @@ public class CommandMinerThread extends MinerThread args[0] = theShell; args[1] = "-c"; //$NON-NLS-1$ args[2] = _invocation; - /* - for (int i = 0; i < inv.length; i++) - { - args[2 + i] = inv[i]; - } - */ + _theProcess = Runtime.getRuntime().exec(args, env, theDirectory); } @@ -487,14 +464,7 @@ public class CommandMinerThread extends MinerThread } else if (input.equals("#enter")) //$NON-NLS-1$ { - if (_isOS400) - { - writer.write("\r"); //$NON-NLS-1$ - } - else - { - writer.newLine(); - } + writer.newLine(); writer.flush(); return; } @@ -531,15 +501,7 @@ public class CommandMinerThread extends MinerThread } writer.write(input); - - if (_isOS400) - { - writer.write("\r"); //$NON-NLS-1$ - } - else - { - writer.newLine(); - } + writer.newLine(); writer.flush(); diff --git a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java index 688bd466341..a8aaec3ea4e 100644 --- a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java +++ b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java @@ -14,6 +14,7 @@ * Contributors: * Javier Montalvo OrĂºs (Symbian) - 138619: Fix codepage on Win2K * Lothar Werzinger (Tradescape) - 161838: Support terminating local shells + * David McKnight (IBM) - [189387] Use specified encoding for shell output *******************************************************************************/ package org.eclipse.rse.internal.services.local.shells; @@ -247,7 +248,8 @@ public class LocalShellThread extends Thread } } - _stdInput = new BufferedReader(new InputStreamReader(_theProcess.getInputStream())); + _stdInput = new BufferedReader(new InputStreamReader(_theProcess.getInputStream(), _encoding)); + _stdError = new BufferedReader(new InputStreamReader(_theProcess.getErrorStream())); } diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/shell/SshHostShell.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/shell/SshHostShell.java index 5daa1c68551..49c923830dd 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/shell/SshHostShell.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/shell/SshHostShell.java @@ -13,6 +13,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - Adapted from LocalHostShell. + * David McKnight (IBM) - [191599] Use the remote encoding specified in the host property page *******************************************************************************/ package org.eclipse.rse.internal.services.ssh.shell; @@ -80,7 +81,7 @@ public class SshHostShell extends AbstractHostShell implements IHostShell { ((ChannelShell)fChannel).setEnv(envTable); } - fStdoutHandler = new SshShellOutputReader(this, new BufferedReader(new InputStreamReader(fChannel.getInputStream())), false); + fStdoutHandler = new SshShellOutputReader(this, new BufferedReader(new InputStreamReader(fChannel.getInputStream(), encoding)), false); fStderrHandler = new SshShellOutputReader(this, null,true); OutputStream outputStream = fChannel.getOutputStream(); //TODO check if encoding or command to execute needs to be considered