Package org.jline.console
Class CommandRegistry.CommandSession
java.lang.Object
org.jline.console.CommandRegistry.CommandSession
- Enclosing interface:
CommandRegistry
Class representing a command execution session.
A CommandSession encapsulates the terminal and I/O streams used for command execution. It provides access to the terminal, input stream, output stream, and error stream for the command being executed.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new command session with the system's standard I/O streams.CommandSession
(Terminal terminal) Creates a new command session with the specified terminal.CommandSession
(Terminal terminal, InputStream in, PrintStream out, PrintStream err) Creates a new command session with the specified terminal and I/O streams. -
Method Summary
-
Constructor Details
-
CommandSession
public CommandSession()Creates a new command session with the system's standard I/O streams. The terminal will be null in this case. -
CommandSession
Creates a new command session with the specified terminal. The I/O streams will be derived from the terminal.- Parameters:
terminal
- the terminal for the command session
-
CommandSession
Creates a new command session with the specified terminal and I/O streams.- Parameters:
terminal
- the terminal for the command sessionin
- the input stream for the command sessionout
- the output stream for the command sessionerr
- the error stream for the command session
-
-
Method Details
-
terminal
Returns the terminal for the command session.- Returns:
- the terminal, or null if no terminal is associated with this session
-
in
Returns the input stream for the command session.- Returns:
- the input stream
-
out
Returns the output stream for the command session.- Returns:
- the output stream
-
err
Returns the error stream for the command session.- Returns:
- the error stream
-