-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
status/need-feedbackCalling participant to provide feedbackCalling participant to provide feedback
Description
This issue occurs on Windows 11, using Windows command line cmd.exe
.
Spring-shell version: 3.2.2
Based on the example provided in version 3.2.2 of the documentation:
https://docs.spring.io/spring-shell/reference/components/ui/multiselect.html
@ShellComponent
public class ComponentCommands extends AbstractShellComponent {
@ShellMethod(key = "component multi", value = "Multi selector", group = "Components")
public String multiSelector() {
List<SelectorItem<String>> items = new ArrayList<>();
items.add(SelectorItem.of("key1", "value1"));
items.add(SelectorItem.of("key2", "value2", false, true));
items.add(SelectorItem.of("key3", "value3"));
MultiItemSelector<String, SelectorItem<String>> component = new MultiItemSelector<>(getTerminal(),
items, "testSimple", null);
component.setResourceLoader(getResourceLoader());
component.setTemplateExecutor(getTemplateExecutor());
MultiItemSelectorContext<String, SelectorItem<String>> context = component
.run(MultiItemSelectorContext.empty());
String result = context.getResultItems().stream()
.map(si -> si.getItem())
.collect(Collectors.joining(","));
return "Got value " + result;
}
}
When calling this command, the user is not prompted to select a value and context.getResultItems()
returns null immediatly.
The same issue occurs with SingleItemSelector
:
Metadata
Metadata
Assignees
Labels
status/need-feedbackCalling participant to provide feedbackCalling participant to provide feedback