View | Details | Raw Unified | Return to bug 261481 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java (+23 lines)
Lines 35-40 Link Here
35
import org.eclipse.core.runtime.OperationCanceledException;
35
import org.eclipse.core.runtime.OperationCanceledException;
36
import org.eclipse.core.runtime.Platform;
36
import org.eclipse.core.runtime.Platform;
37
import org.eclipse.osgi.util.NLS;
37
import org.eclipse.osgi.util.NLS;
38
import org.eclipse.rse.core.IRSESystemType;
38
import org.eclipse.rse.core.RSECorePlugin;
39
import org.eclipse.rse.core.RSECorePlugin;
39
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
40
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
40
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
41
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
Lines 69-74 Link Here
69
{
70
{
70
	private static String COMMAND_SHELLS_MEMENTO = "commandshells"; //$NON-NLS-1$
71
	private static String COMMAND_SHELLS_MEMENTO = "commandshells"; //$NON-NLS-1$
71
	private static String ENVIRONMENT_VARS = "EnvironmentVariables"; //$NON-NLS-1$
72
	private static String ENVIRONMENT_VARS = "EnvironmentVariables"; //$NON-NLS-1$
73
	private static final String DEFAULT_PROMPT_COMMAND = "echo $PWD'>'"; //$NON-NLS-1$
72
74
73
	protected ArrayList _cmdShells;
75
	protected ArrayList _cmdShells;
74
76
Lines 1289-1292 Link Here
1289
			throws InvocationTargetException, InterruptedException
1291
			throws InvocationTargetException, InterruptedException
1290
	{
1292
	{
1291
	}
1293
	}
1294
	
1295
	/**
1296
	 * @since 3.0
1297
	 */
1298
	public String getPromptCommand(){		
1299
		String result = getHost().getSystemType().getProperty(IRSESystemType.PROPERTY_PROMPT_COMMAND);
1300
				if(result!=null && !result.trim().equals("")) //$NON-NLS-1$
1301
					return result;
1302
				return DEFAULT_PROMPT_COMMAND;
1303
		
1304
	}
1305
	
1306
	/**
1307
	 * @since 3.0
1308
	 */
1309
	public String getShellType(){
1310
		String result = getHost().getSystemType().getProperty(IRSESystemType.PROPERTY_SHELL_TYPE);
1311
				if(result!=null)
1312
					return result;
1313
				return ""; //$NON-NLS-1$
1314
	}
1292
}
1315
}
(-)src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java (+8 lines)
Lines 199-203 Link Here
199
	
199
	
200
	public List getHostEnvironmentVariables();
200
	public List getHostEnvironmentVariables();
201
	
201
	
202
	/**
203
	 * @since 3.0
204
	 */
205
	public String getPromptCommand();
202
	
206
	
207
	/**
208
	 * @since 3.0
209
	 */
210
	public String getShellType();
203
}
211
}
(-).settings/.api_filters (+17 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component id="org.eclipse.rse.subsystems.shells.core" version="2">
3
<resource path="src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java" type="org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem">
4
<filter id="403804204">
5
<message_arguments>
6
<message_argument value="org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem"/>
7
<message_argument value="getShellType()"/>
8
</message_arguments>
9
</filter>
10
<filter id="403804204">
11
<message_arguments>
12
<message_argument value="org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem"/>
13
<message_argument value="getPromptCommand()"/>
14
</message_arguments>
15
</filter>
16
</resource>
17
</component>
(-)src/org/eclipse/rse/core/IRSESystemType.java (-1 / +12 lines)
Lines 221-226 Link Here
221
	 */
221
	 */
222
	public static final String PROPERTY_SUPPORTS_ENCODING = "supportsEncoding"; //$NON-NLS-1$
222
	public static final String PROPERTY_SUPPORTS_ENCODING = "supportsEncoding"; //$NON-NLS-1$
223
223
224
	
225
	/**
226
	 * @since 3.1
227
	 */
228
	public static final String PROPERTY_SHELL_TYPE = "shellType"; //$NON-NLS-1$
229
230
	/**
231
	 * @since 3.1
232
	 */
233
	public static final String PROPERTY_PROMPT_COMMAND = "promptCommand"; //$NON-NLS-1$
234
	
224
	/**
235
	/**
225
	 * Returns the id of the system type.
236
	 * Returns the id of the system type.
226
	 * @return the id of the system type
237
	 * @return the id of the system type
Lines 322-328 Link Here
322
	 * @return true if the system type refers to a Windows system.
333
	 * @return true if the system type refers to a Windows system.
323
	 */
334
	 */
324
	public boolean isWindows();
335
	public boolean isWindows();
325
336
	
326
	/**
337
	/**
327
	 * Returns the bundle which is responsible for the definition of this system type.
338
	 * Returns the bundle which is responsible for the definition of this system type.
328
	 * Typically this is used as a base for searching for images and other files
339
	 * Typically this is used as a base for searching for images and other files
(-)src/org/eclipse/rse/internal/subsystems/shells/ssh/SshServiceCommandShell.java (-7 / +1 lines)
Lines 28-34 Link Here
28
import org.eclipse.core.runtime.Path;
28
import org.eclipse.core.runtime.Path;
29
29
30
import org.eclipse.rse.core.subsystems.ISubSystem;
30
import org.eclipse.rse.core.subsystems.ISubSystem;
31
import org.eclipse.rse.internal.services.shells.TerminalServiceHostShell;
32
import org.eclipse.rse.services.shells.IHostOutput;
31
import org.eclipse.rse.services.shells.IHostOutput;
33
import org.eclipse.rse.services.shells.IHostShell;
32
import org.eclipse.rse.services.shells.IHostShell;
34
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
33
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
Lines 182-193 Link Here
182
	 * @return String promptCommand
181
	 * @return String promptCommand
183
	 */
182
	 */
184
	protected String getPromptCommand() {
183
	protected String getPromptCommand() {
185
		IHostShell shell = getHostShell();
184
		return _cmdSubSystem.getPromptCommand();
186
		if (shell instanceof TerminalServiceHostShell) {
187
			return ((TerminalServiceHostShell)shell).getPromptCommand();
188
		}
189
		//return something impossible such that nothing is ever matched
190
		return "\uffff"; //$NON-NLS-1$
191
	}
185
	}
192
186
193
	public void writeToShell(String cmd)
187
	public void writeToShell(String cmd)
(-)src/org/eclipse/rse/internal/subsystems/shells/telnet/TelnetServiceCommandShell.java (-8 / +1 lines)
Lines 27-33 Link Here
27
import org.eclipse.core.runtime.NullProgressMonitor;
27
import org.eclipse.core.runtime.NullProgressMonitor;
28
import org.eclipse.core.runtime.Path;
28
import org.eclipse.core.runtime.Path;
29
import org.eclipse.rse.core.subsystems.ISubSystem;
29
import org.eclipse.rse.core.subsystems.ISubSystem;
30
import org.eclipse.rse.internal.services.shells.TerminalServiceHostShell;
31
import org.eclipse.rse.services.shells.IHostOutput;
30
import org.eclipse.rse.services.shells.IHostOutput;
32
import org.eclipse.rse.services.shells.IHostShell;
31
import org.eclipse.rse.services.shells.IHostShell;
33
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
32
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
Lines 175-187 Link Here
175
	 * @return String promptCommand
174
	 * @return String promptCommand
176
	 */
175
	 */
177
	protected String getPromptCommand() {
176
	protected String getPromptCommand() {
178
		IHostShell shell = getHostShell();
177
		return _cmdSubSystem.getPromptCommand();
179
		//assert shell instanceof TelnetHostShell;
180
		if (shell instanceof TerminalServiceHostShell) {
181
			return ((TerminalServiceHostShell)shell).getPromptCommand();
182
		}
183
		//return something impossible such that nothing is ever matched
184
		return "\uffff"; //$NON-NLS-1$
185
	}
178
	}
186
179
187
	public void writeToShell(String cmd)
180
	public void writeToShell(String cmd)

Return to bug 261481