Skip to content

Command completion selection should be sanitised #1228

@fmbenhassine

Description

@fmbenhassine

As of v4.0 RC1, command completion shows a \ character when pressing Tab and when selecting a sub-command. Here is an example from the petclinic sample app:

shell:>help
Available commands:
Built-In Commands
	script: Execute commands from a script file
	clear: Clear the terminal screen
	help: Display help about available commands
	version: Show version info
Owners
	owners list: List owners
	owners info: Show details of a given owner
Pets
	pets info: Show detail about a given pet
	pets list: List pets
Vets
	vets list: List veterinarians
	vets info: Show details of a given veterinarian

shell:>owners\ list
Owners
owners list: List owners

When typing own + Tab, the completion works as expected, but there is an additional \ that should be removed. I am not sure, but it seems like there is a utility method in v3 org.springframework.shell.core.utils.Utils#sanitizeInput for that and which might probably be adapted/used in org.springframework.shell.jline.CommandCompleter.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions