Thank you for fixing this in unstable. Can this fix be merged into stable (stretch)? It looks like the bug was actually fixed in sid *as stretch was being released* and due to that unfortunate timing was not able to make it into stretch via the unstable->testing migration path.
I've been running stretch with this patch manually applied; AFAICT it works fine there-- and it's quite a frustrating bug to not have autocompletion on some of the longer IDs... ;) (for example any schroot session-ID...)