Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 127347 Details for
Bug 261481
[api] Add API for getting the kind of remote shell and its prompt command
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
second draft
shells-promptCommandAPI.diff (text/plain), 7.93 KB, created by
Anna Dushistova
on 2009-03-03 12:46:14 EST
(
hide
)
Description:
second draft
Filename:
MIME Type:
Creator:
Anna Dushistova
Created:
2009-03-03 12:46:14 EST
Size:
7.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.subsystems.shells.core >Index: src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java,v >retrieving revision 1.25 >diff -u -r1.25 RemoteCmdSubSystem.java >--- src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java 7 Nov 2008 13:27:00 -0000 1.25 >+++ src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java 3 Mar 2009 17:45:01 -0000 >@@ -35,6 +35,7 @@ > import org.eclipse.core.runtime.OperationCanceledException; > import org.eclipse.core.runtime.Platform; > import org.eclipse.osgi.util.NLS; >+import org.eclipse.rse.core.IRSESystemType; > import org.eclipse.rse.core.RSECorePlugin; > import org.eclipse.rse.core.events.ISystemResourceChangeEvents; > import org.eclipse.rse.core.events.SystemResourceChangeEvent; >@@ -69,6 +70,7 @@ > { > private static String COMMAND_SHELLS_MEMENTO = "commandshells"; //$NON-NLS-1$ > private static String ENVIRONMENT_VARS = "EnvironmentVariables"; //$NON-NLS-1$ >+ private static final String DEFAULT_PROMPT_COMMAND = "echo $PWD'>'"; //$NON-NLS-1$ > > protected ArrayList _cmdShells; > >@@ -1289,4 +1291,25 @@ > throws InvocationTargetException, InterruptedException > { > } >+ >+ /** >+ * @since 3.0 >+ */ >+ public String getPromptCommand(){ >+ String result = getHost().getSystemType().getProperty(IRSESystemType.PROPERTY_PROMPT_COMMAND); >+ if(result!=null && !result.trim().equals("")) //$NON-NLS-1$ >+ return result; >+ return DEFAULT_PROMPT_COMMAND; >+ >+ } >+ >+ /** >+ * @since 3.0 >+ */ >+ public String getShellType(){ >+ String result = getHost().getSystemType().getProperty(IRSESystemType.PROPERTY_SHELL_TYPE); >+ if(result!=null) >+ return result; >+ return ""; //$NON-NLS-1$ >+ } > } >Index: src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java,v >retrieving revision 1.12 >diff -u -r1.12 IRemoteCmdSubSystem.java >--- src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java 14 Nov 2008 16:48:03 -0000 1.12 >+++ src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java 3 Mar 2009 17:45:01 -0000 >@@ -199,5 +199,13 @@ > > public List getHostEnvironmentVariables(); > >+ /** >+ * @since 3.0 >+ */ >+ public String getPromptCommand(); > >+ /** >+ * @since 3.0 >+ */ >+ public String getShellType(); > } >\ No newline at end of file >Index: .settings/.api_filters >=================================================================== >RCS file: .settings/.api_filters >diff -N .settings/.api_filters >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .settings/.api_filters 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,17 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<component id="org.eclipse.rse.subsystems.shells.core" version="2"> >+<resource path="src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java" type="org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem"> >+<filter id="403804204"> >+<message_arguments> >+<message_argument value="org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem"/> >+<message_argument value="getShellType()"/> >+</message_arguments> >+</filter> >+<filter id="403804204"> >+<message_arguments> >+<message_argument value="org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem"/> >+<message_argument value="getPromptCommand()"/> >+</message_arguments> >+</filter> >+</resource> >+</component> >#P org.eclipse.rse.core >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 3 Mar 2009 17:45:02 -0000 >@@ -221,6 +221,17 @@ > */ > 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$ >+ > /** > * Returns the id of the system type. > * @return the id of the system type >@@ -322,7 +333,7 @@ > * @return true if the system type refers to a Windows system. > */ > public boolean isWindows(); >- >+ > /** > * 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 >#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 3 Mar 2009 17:45:03 -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.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 3 Mar 2009 17:45:05 -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.getPromptCommand(); > } > > public void writeToShell(String cmd)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 261481
:
127224
| 127347