1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 14:15:23 +02:00

[372968] [dstore][shell] provide support for csh and tcsh shells

This commit is contained in:
David McKnight 2012-03-06 13:48:58 +00:00
parent aac7baa511
commit dd35bf78c6
2 changed files with 16 additions and 7 deletions

View file

@ -35,6 +35,7 @@
* David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support
* David McKnight (IBM) [339741] [dstore][shells] consecutive prompt line is ignored
* Noriaki Takatsu (IBM) [369767] [multithread][dstore] Invalid Default directory in shell Launch
* David McKnight (IBM) [372968] [dstore][shell] provide support for csh and tcsh shells
*******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.command;
@ -273,9 +274,10 @@ public class CommandMinerThread extends MinerThread
{
isSHonZ = true;
}
else if (theShell.endsWith("/csh") || theShell.endsWith("/bsh")){ //$NON-NLS-1$//$NON-NLS-2$
else if (theShell.endsWith("/csh") || theShell.endsWith("/tcsh") || theShell.endsWith("/bsh")){ //$NON-NLS-1$//$NON-NLS-2$
_isCsh = true;
}
}
// In a single-process server, both user.home and HOME don't represent
// each client home directory.
@ -556,13 +558,18 @@ public class CommandMinerThread extends MinerThread
if (didLogin || _isTTY)
{
// unsupported prompting
boolean unsupportedPrompt = theShell.endsWith("csh") || theShell.endsWith("bsh") || //$NON-NLS-1$//$NON-NLS-2$
boolean unsupportedPrompt = theShell.endsWith("bsh") || //$NON-NLS-1$//$NON-NLS-2$
theShell.endsWith("tsh") || theShell.endsWith("rksh"); //$NON-NLS-1$//$NON-NLS-2$
String initCmd = ""; //$NON-NLS-1$
if (_isTTY && !unsupportedPrompt){
initCmd = "export PS1='$PWD>';" ; //$NON-NLS-1$
if (_isCsh){
initCmd = "set prompt=\"$PWD>\""; //$NON-NLS-1$
}
else {
initCmd = "export PS1='$PWD>';" ; //$NON-NLS-1$
}
}
if (didLogin && !userHome.equals(_cwdStr)){
initCmd += "cd " + _cwdStr; //$NON-NLS-1$
@ -686,7 +693,7 @@ public class CommandMinerThread extends MinerThread
UniversalServerUtilities.logInfo(getName(), "shell input after char conversion="+input, _dataStore); //$NON-NLS-1$
if (_isCsh && origInput.startsWith("export ")){ //$NON-NLS-1$
input = origInput.replaceAll("export ", "set "); //$NON-NLS-1$//$NON-NLS-2$
input = origInput.replaceAll("export ", "setenv ").replaceAll("=", " "); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
try

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2011 IBM Corporation and others.
* Copyright (c) 2006, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -24,6 +24,7 @@
* David McKnight (IBM) [312415] [dstore] shell service interprets < and > sequences - handle old client/new server case
* David McKnight (IBM) [341366] [dstore][shells] codepage IBM-1141 has faulty display of \ character
* David McKnight (IBM) [343421] [dstore] Man page was not displayed properly in the shell
* David McKnight (IBM) [372968] [dstore][shell] provide support for csh and tcsh shells
*******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.command;
@ -295,8 +296,9 @@ public class OutputHandler extends Handler {
String lastLine = output[index - 1];
boolean endLine = fullOutput.endsWith("\n") || fullOutput.endsWith("\r") || fullOutput.endsWith(">");
boolean endLine = fullOutput.endsWith("\n") || fullOutput.endsWith("\r") || //$NON-NLS-1$//$NON-NLS-2$
fullOutput.endsWith(">") || //$NON-NLS-1$
fullOutput.endsWith("% "); // csh/tcsh //$NON-NLS-1$
if (!_endOfStream && !endLine)
{
// our last line may be cut off