diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java index 4f5c4ee6f15..366060da16f 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java @@ -39,6 +39,8 @@ import org.eclipse.rse.services.ssh.ISshSessionProvider; */ public class SshHostShell extends AbstractHostShell implements IHostShell { + public static final String SHELL_INVOCATION = ">"; //$NON-NLS-1$ + private ISshSessionProvider fSessionProvider; private Channel fChannel; private SshShellOutputReader fStdoutHandler; @@ -54,7 +56,7 @@ public class SshHostShell extends AbstractHostShell implements IHostShell { ////By default, jsch always creates a vt100 connection sized ////80x24 / 640x480 (dimensions can be changed). ////I wonder whether jsch could give us a dumb terminal? - //if(fChannel instanceof ChannelShell) { + //if(commandToRun!=null && !commandToRun.equals(SHELL_INVOCATION) & (fChannel instanceof ChannelShell)) { // ((ChannelShell)fChannel).setPty(false); //} @@ -93,6 +95,9 @@ public class SshHostShell extends AbstractHostShell implements IHostShell { ) { writeToShell("cd "+initialWorkingDirectory); //$NON-NLS-1$ } + if(commandToRun!=null && commandToRun.length()>0 && !commandToRun.equals(SHELL_INVOCATION)) { + writeToShell(commandToRun); + } } catch(Exception e) { //TODO Forward exception to RSE properly e.printStackTrace(); @@ -111,7 +116,7 @@ public class SshHostShell extends AbstractHostShell implements IHostShell { protected void start(IProgressMonitor monitor) { //TODO Move stuff from constructor to here - //TODO Set up environment variables fro proper prompting, e.g. like dstore + //TODO Set up environment variables for proper prompting, e.g. like dstore //varTable.put("PS1","$PWD/>"); //varTable.put("COLUMNS","256"); //alias ls='ls -1' diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshShellService.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshShellService.java index bf6137aa71e..df5a5007ecd 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshShellService.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshShellService.java @@ -31,7 +31,6 @@ import org.eclipse.rse.services.ssh.SshServiceResources; */ public class SshShellService implements ISshService, IShellService { - private static final String SHELL_INVOCATION = ">"; //$NON-NLS-1$ private ISshSessionProvider fSessionProvider; public SshShellService(ISshSessionProvider sessionProvider) { @@ -48,7 +47,7 @@ public class SshShellService implements ISshService, IShellService { public IHostShell launchShell(IProgressMonitor monitor, String initialWorkingDirectory, String encoding, String[] environment) { - SshHostShell hostShell = new SshHostShell(fSessionProvider, initialWorkingDirectory, SHELL_INVOCATION, encoding, environment); + SshHostShell hostShell = new SshHostShell(fSessionProvider, initialWorkingDirectory, SshHostShell.SHELL_INVOCATION, encoding, environment); return hostShell; } @@ -59,7 +58,6 @@ public class SshShellService implements ISshService, IShellService { return runCommand(monitor, initialWorkingDirectory, command, defaultEncoding, environment); } - //TODO command is ignored by SshHostShell for now (just like DStoreHostShell). public IHostShell runCommand(IProgressMonitor monitor, String initialWorkingDirectory, String command, String encoding, String[] environment) {