1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

[290743] [dstore][shells] allow bash shells and custom shell invocation

This commit is contained in:
David McKnight 2009-09-29 13:04:37 +00:00
parent 2736805097
commit 5fb4c2106f

View file

@ -22,6 +22,7 @@
* David McKnight (IBM) [153275] [dstore-shells] Ctrl+C does not break remote program * David McKnight (IBM) [153275] [dstore-shells] Ctrl+C does not break remote program
* David McKnight (IBM) [284179] [dstore] commands have a hard coded line length limit of 100 characters * David McKnight (IBM) [284179] [dstore] commands have a hard coded line length limit of 100 characters
* David McKnight (IBM) - [286671] Dstore shell service interprets < and > sequences * David McKnight (IBM) - [286671] Dstore shell service interprets < and > sequences
* David McKnight (IBM) [290743] [dstore][shells] allow bash shells and custom shell invocation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.command; package org.eclipse.rse.internal.dstore.universal.miners.command;
@ -198,10 +199,7 @@ public class CommandMinerThread extends MinerThread
} }
else else
{ {
isBash = true; isBash = true;
// no bash!
theShell = "sh"; //$NON-NLS-1$
} }
} }
else if (theShell.endsWith("sh") && isZ)//$NON-NLS-1$ else if (theShell.endsWith("sh") && isZ)//$NON-NLS-1$
@ -220,6 +218,11 @@ public class CommandMinerThread extends MinerThread
} }
} }
// check for custom shell invocation
String customShellInvocation = System.getProperty("DSTORE_SHELL_INVOCATION"); //$NON-NLS-1$
if (customShellInvocation != null && customShellInvocation.length() > 0){
theShell = customShellInvocation;
}
if (theShell == null) if (theShell == null)
{ {
@ -320,25 +323,31 @@ public class CommandMinerThread extends MinerThread
} }
else else
{ {
if (isBashonZ) if (customShellInvocation != null && customShellInvocation.length() > 0){
{ // all handled in the custom shell invocation
_theProcess = Runtime.getRuntime().exec(_invocation + " --login", env, theDirectory); //$NON-NLS-1$
didLogin = true;
}
else if (isBash)
{
_theProcess = Runtime.getRuntime().exec(_invocation + " -l", env, theDirectory); //$NON-NLS-1$
didLogin = true;
}
else if (isSHonZ)
{
_theProcess = Runtime.getRuntime().exec(_invocation + " -L", env, theDirectory); //$NON-NLS-1$
didLogin = true;
}
else
{
_theProcess = Runtime.getRuntime().exec(_invocation, env, theDirectory); _theProcess = Runtime.getRuntime().exec(_invocation, env, theDirectory);
} }
else {
if (isBashonZ)
{
_theProcess = Runtime.getRuntime().exec(_invocation + " --login", env, theDirectory); //$NON-NLS-1$
didLogin = true;
}
else if (isBash)
{
_theProcess = Runtime.getRuntime().exec(_invocation + " -l", env, theDirectory); //$NON-NLS-1$
didLogin = true;
}
else if (isSHonZ)
{
_theProcess = Runtime.getRuntime().exec(_invocation + " -L", env, theDirectory); //$NON-NLS-1$
didLogin = true;
}
else
{
_theProcess = Runtime.getRuntime().exec(_invocation, env, theDirectory);
}
}
} }
} }
else else