### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.core Index: src/org/eclipse/rse/core/AbstractRSESystemType.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/AbstractRSESystemType.java,v retrieving revision 1.6 diff -u -r1.6 AbstractRSESystemType.java --- src/org/eclipse/rse/core/AbstractRSESystemType.java 18 Apr 2008 09:19:53 -0000 1.6 +++ src/org/eclipse/rse/core/AbstractRSESystemType.java 2 Mar 2009 20:52:30 -0000 @@ -199,6 +199,27 @@ return new Host(profile); } + /** + * @since 3.1 + */ + public String getShellType(){ + String result = getProperty(IRSESystemType.PROPERTY_SHELL_TYPE); + if(result!=null) + return result; + return ""; //$NON-NLS-1$ + } + + /** + * @since 3.1 + */ + public String getPromptCommand(){ + String result = getProperty(IRSESystemType.PROPERTY_PROMPT_COMMAND); + if(result!=null && !result.trim().equals("")) //$NON-NLS-1$ + return result; + return IRSESystemType.DEFAULT_PROMPT_COMMAND; + } + + /* (non-Javadoc) * @see java.lang.Object#toString() */ Index: src/org/eclipse/rse/core/IRSESystemType.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java,v retrieving revision 1.23 diff -u -r1.23 IRSESystemType.java --- src/org/eclipse/rse/core/IRSESystemType.java 19 Jan 2009 14:04:36 -0000 1.23 +++ src/org/eclipse/rse/core/IRSESystemType.java 2 Mar 2009 20:52:30 -0000 @@ -221,6 +221,22 @@ */ public static final String PROPERTY_SUPPORTS_ENCODING = "supportsEncoding"; //$NON-NLS-1$ + + /** + * @since 3.1 + */ + public static final String PROPERTY_SHELL_TYPE = "shellType"; //$NON-NLS-1$ + + /** + * @since 3.1 + */ + public static final String PROPERTY_PROMPT_COMMAND = "promptCommand"; //$NON-NLS-1$ + + /** + * @since 3.1 + */ + public static final String DEFAULT_PROMPT_COMMAND = "echo $PWD'>'"; //$NON-NLS-1$ + /** * Returns the id of the system type. * @return the id of the system type @@ -324,6 +340,16 @@ public boolean isWindows(); /** + * @since 3.1 + */ + public String getShellType(); + + /** + * @since 3.1 + */ + public String getPromptCommand(); + + /** * Returns the bundle which is responsible for the definition of this system type. * Typically this is used as a base for searching for images and other files * that are needed in presenting the system type. #P org.eclipse.rse.subsystems.shells.ssh Index: src/org/eclipse/rse/internal/subsystems/shells/ssh/SshServiceCommandShell.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.shells.ssh/src/org/eclipse/rse/internal/subsystems/shells/ssh/SshServiceCommandShell.java,v retrieving revision 1.8 diff -u -r1.8 SshServiceCommandShell.java --- src/org/eclipse/rse/internal/subsystems/shells/ssh/SshServiceCommandShell.java 23 Jan 2009 10:40:23 -0000 1.8 +++ src/org/eclipse/rse/internal/subsystems/shells/ssh/SshServiceCommandShell.java 2 Mar 2009 20:52:32 -0000 @@ -28,7 +28,6 @@ import org.eclipse.core.runtime.Path; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.internal.services.shells.TerminalServiceHostShell; import org.eclipse.rse.services.shells.IHostOutput; import org.eclipse.rse.services.shells.IHostShell; import org.eclipse.rse.services.shells.IHostShellChangeEvent; @@ -182,12 +181,7 @@ * @return String promptCommand */ protected String getPromptCommand() { - IHostShell shell = getHostShell(); - if (shell instanceof TerminalServiceHostShell) { - return ((TerminalServiceHostShell)shell).getPromptCommand(); - } - //return something impossible such that nothing is ever matched - return "\uffff"; //$NON-NLS-1$ + return _cmdSubSystem.getHost().getSystemType().getPromptCommand(); } public void writeToShell(String cmd) #P org.eclipse.rse.subsystems.shells.telnet Index: src/org/eclipse/rse/internal/subsystems/shells/telnet/TelnetServiceCommandShell.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.shells.telnet/src/org/eclipse/rse/internal/subsystems/shells/telnet/TelnetServiceCommandShell.java,v retrieving revision 1.5 diff -u -r1.5 TelnetServiceCommandShell.java --- src/org/eclipse/rse/internal/subsystems/shells/telnet/TelnetServiceCommandShell.java 23 Jan 2009 10:40:20 -0000 1.5 +++ src/org/eclipse/rse/internal/subsystems/shells/telnet/TelnetServiceCommandShell.java 2 Mar 2009 20:52:33 -0000 @@ -27,7 +27,6 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.rse.core.subsystems.ISubSystem; -import org.eclipse.rse.internal.services.shells.TerminalServiceHostShell; import org.eclipse.rse.services.shells.IHostOutput; import org.eclipse.rse.services.shells.IHostShell; import org.eclipse.rse.services.shells.IHostShellChangeEvent; @@ -175,13 +174,7 @@ * @return String promptCommand */ protected String getPromptCommand() { - IHostShell shell = getHostShell(); - //assert shell instanceof TelnetHostShell; - if (shell instanceof TerminalServiceHostShell) { - return ((TerminalServiceHostShell)shell).getPromptCommand(); - } - //return something impossible such that nothing is ever matched - return "\uffff"; //$NON-NLS-1$ + return _cmdSubSystem.getHost().getSystemType().getPromptCommand(); } public void writeToShell(String cmd)