You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Components like StringInput and others either used manually or via ComponentFlow should not try to enter interactive mode if there is no tty as there would never be any user input.
First issue is that components should not even fail without tty
$ java -jar spring-shell-samples/target/spring-shell-samples-2.1.0-SNAPSHOT.jar component string --mask false < /dev/null
java.lang.NullPointerException
java.lang.NullPointerException
at org.springframework.shell.component.StringInput.read(StringInput.java:87)
at org.springframework.shell.component.StringInput.read(StringInput.java:39)
Secondly if component is not configured to accept default values, it should never ask anything from a user.
We probably need to return either empty context for component result or having everything within context empty/null. This is usually beyond command parsing and start of an command execution so we can't handle everything within core shell itself. Essentially user need to check and throw exception indicating that some options were missing(which is a bit awkward as command option may not be required as component itself may have a default).
The text was updated successfully, but these errors were encountered:
- Adding a concept of no-tty which in this commit simply
tracks DumbTerminal as jline creates that if there nothing
better.
- For components without tty don't go to interaction loop.
- For new sample show that we can at least manually handle
required option with a flow while command option is not
required.
- Fixesspring-projects#444
- Adding a concept of no-tty which in this commit simply
tracks DumbTerminal as jline creates that if there nothing
better.
- For components without tty don't go to interaction loop.
- For new sample show that we can at least manually handle
required option with a flow while command option is not
required.
- Fixes#444
Components like
StringInput
and others either used manually or viaComponentFlow
should not try to enter interactive mode if there is no tty as there would never be any user input.First issue is that components should not even fail without tty
Secondly if component is not configured to accept default values, it should never ask anything from a user.
We probably need to return either empty context for component result or having everything within context empty/null. This is usually beyond command parsing and start of an command execution so we can't handle everything within core shell itself. Essentially user need to check and throw exception indicating that some options were missing(which is a bit awkward as command option may not be required as component itself may have a default).
The text was updated successfully, but these errors were encountered: