public class NshConfig extends Object implements Cloneable
NshConfig is used at shell initialization time (passed to Nsh(NshConfig))
to wire the shell engine's architecture and subsystems:
NshEvaluator, NshCommandTypeResolver,
NshErrorHandler, NshExternalExecutor, NshHistoryappId and serviceName (used for history files and properties)args, a custom NshOptionsParser, or pre-configured NshOptionsNshConfig and NshOptionsNshConfig = Engine Wiring & Setup Configuration.
Configures how the NSH engine itself is built, which components are injected, and which
features are enabled. It is configured programmatically prior to shell startup.NshOptions = Session Runtime Flags & POSIX/Bash Options.
Represents the command-line flags and runtime session state (such as -c, -i,
--bash, --posix, -x, -e, startup scripts, and positional arguments).
Can be modified dynamically at runtime (e.g. via set -x).Nsh,
NshOptions| Constructor and Description |
|---|
NshConfig() |
public String[] getArgs()
public NshOptions getOptions()
getArgs()
using getOptionsParser().public NshConfig setOptions(NshOptions options)
options - pre-configured optionspublic String getServiceName()
"nsh").
Used for the history filename (<serviceName>.history) and
default shell prompt title. Defaults to appId.artifactId().public NshConfig setServiceName(String serviceName)
serviceName - service/application namepublic String getAppName()
getServiceName(), representing the application/shell name.public NshConfig setAppName(String appName)
setServiceName(String), representing the application/shell name.appName - application namepublic NshOptionsParser getOptionsParser()
public NshConfig setShellOptionsParser(NshOptionsParser shellOptionsParser)
public NshEvaluator getEvaluator()
public NshConfig setEvaluator(NshEvaluator evaluator)
public NshCommandTypeResolver getCommandTypeResolver()
public NshConfig setCommandTypeResolver(NshCommandTypeResolver commandTypeResolver)
public NshErrorHandler getErrorHandler()
public NshConfig setErrorHandler(NshErrorHandler errorHandler)
public NshExternalExecutor getExternalExecutor()
public NshConfig setExternalExecutor(NshExternalExecutor externalExecutor)
public NshHistory getHistory()
public NshConfig setHistory(NshHistory history)
public NId getAppId()
public Predicate<NshBuiltin> getBuiltinFilter()
public NshConfig setBuiltinFilter(Predicate<NshBuiltin> builtinFilter)
public NshConfig setHeaderMessageSupplier(Supplier<NMsg> headerMessageSupplier)
public Boolean getIncludeCoreBuiltins()
public Boolean getIncludeDefaultBuiltins()
public NshConfig setIncludeDefaultBuiltins(Boolean includeDefaultBuiltins)
public Boolean getIncludeExternalExecutor()
public NshConfig setIncludeExternalExecutor(Boolean includeExternalExecutor)
public Boolean getIncludeHistory()
public NshConfig copy()
Copyright © 2026 vpc open source initiative. All rights reserved.