Details
Description
We can see two behaviours for the completion using subshell:
1. the "new" behaviour: the completer only shows the direct subshell to the current shell, and commands to the current shell (not all commands from all shells/scopes)
2. an alternative to the 1. is to have completion for all commands when we are not in a subshell, and, when we are in a subshell, only the commands local to this subshell.
3. the "old" behaviour: the completer displays commands from all shells/scopes, and all subshells.
I add a session property (karaf.completionMode) to define which mode is used by the CommandsCompleter.
The initial value of the completionMode is populated with the completionMode property from etc/org.apache.karaf.shell.cfg file.
I also provide a command (shell:completion MODE) to define the completion mode that the user wants to use. The user can change the completion mode on the fly, while using the console.