ShellContextImpl shellContextImpl = new ShellContextImpl(this, currentResource, listeners);
for (CommandExecutionListener listener : executionListeners)
{
shellContextImpl.addCommandExecutionListener(listener);
}
ExportManager exportManager = console.getExportManager();
if (exportManager != null)
{
Map<Object, Object> attributeMap = shellContextImpl.getAttributeMap();
for (String variableName : exportManager.getAllNames())
{
// Variable name ends with "=". Aesh Bug?
if (variableName.endsWith("="))
{
variableName = variableName.split("=")[0];
}
String variableValue = exportManager.getValue(variableName);
attributeMap.put(variableName, variableValue);
}
}
return shellContextImpl;
}