Currently, the Completer function which can be added to command only receives fully completed words as arguments.
For finer-granular control it would be awesome to add also the prefix added so far to the arguments list for the completer function. This would allow completions which depend on the current input, like ls /usr/loc + TAB does complete only on directories found in /usr starting with loc (so the completer function would need to know that the user typed in /usr/loc to perform this kind of dynamic completion.
Currently, the
Completer
function which can be added to command only receives fully completed words as arguments.For finer-granular control it would be awesome to add also the
prefix
added so far to the arguments list for the completer function. This would allow completions which depend on the current input, likels /usr/loc
+ TAB does complete only on directories found in/usr
starting withloc
(so the completer function would need to know that the user typed in/usr/loc
to perform this kind of dynamic completion.For backwards compatibility it's probably out of scope to change the signature of https://github.com/abiosoft/ishell/blob/8b8aa74a85127192b469453a72fd7971b47481fb/command.go#L29, so I suggest to a new member
CompleterWithPrefix
.