mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-18 22:45:23 +02:00
[372968] [dstore][shell] provide support for csh and tcsh shells
This commit is contained in:
parent
aac7baa511
commit
dd35bf78c6
2 changed files with 16 additions and 7 deletions
|
@ -35,6 +35,7 @@
|
||||||
* David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support
|
* 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
|
* David McKnight (IBM) [339741] [dstore][shells] consecutive prompt line is ignored
|
||||||
* Noriaki Takatsu (IBM) [369767] [multithread][dstore] Invalid Default directory in shell Launch
|
* 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;
|
package org.eclipse.rse.internal.dstore.universal.miners.command;
|
||||||
|
@ -273,9 +274,10 @@ public class CommandMinerThread extends MinerThread
|
||||||
{
|
{
|
||||||
isSHonZ = true;
|
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;
|
_isCsh = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// In a single-process server, both user.home and HOME don't represent
|
// In a single-process server, both user.home and HOME don't represent
|
||||||
// each client home directory.
|
// each client home directory.
|
||||||
|
@ -556,14 +558,19 @@ public class CommandMinerThread extends MinerThread
|
||||||
if (didLogin || _isTTY)
|
if (didLogin || _isTTY)
|
||||||
{
|
{
|
||||||
// unsupported prompting
|
// 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$
|
theShell.endsWith("tsh") || theShell.endsWith("rksh"); //$NON-NLS-1$//$NON-NLS-2$
|
||||||
|
|
||||||
|
|
||||||
String initCmd = ""; //$NON-NLS-1$
|
String initCmd = ""; //$NON-NLS-1$
|
||||||
if (_isTTY && !unsupportedPrompt){
|
if (_isTTY && !unsupportedPrompt){
|
||||||
|
if (_isCsh){
|
||||||
|
initCmd = "set prompt=\"$PWD>\""; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
else {
|
||||||
initCmd = "export PS1='$PWD>';" ; //$NON-NLS-1$
|
initCmd = "export PS1='$PWD>';" ; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (didLogin && !userHome.equals(_cwdStr)){
|
if (didLogin && !userHome.equals(_cwdStr)){
|
||||||
initCmd += "cd " + _cwdStr; //$NON-NLS-1$
|
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$
|
UniversalServerUtilities.logInfo(getName(), "shell input after char conversion="+input, _dataStore); //$NON-NLS-1$
|
||||||
|
|
||||||
if (_isCsh && origInput.startsWith("export ")){ //$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
|
try
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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) [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) [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) [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;
|
package org.eclipse.rse.internal.dstore.universal.miners.command;
|
||||||
|
@ -295,8 +296,9 @@ public class OutputHandler extends Handler {
|
||||||
|
|
||||||
String lastLine = output[index - 1];
|
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)
|
if (!_endOfStream && !endLine)
|
||||||
{
|
{
|
||||||
// our last line may be cut off
|
// our last line may be cut off
|
||||||
|
|
Loading…
Add table
Reference in a new issue