Fix autocompletion issue.

The issue will prompt wrong autocompletion prompt.
Fix prompt only the minimum common string from available
autocompletion strings.