This is going to be very hard to explain over email. I tried to use script from util-linux in GNU bash v.5.1.16 on Ubuntu 22.04, but that doesn't seem to offer any help.
Here's a tree to show the directory structure and let's say I want to move the Hofstadter book to /dev/shm/cache. I'll try tab completion after entering ` "Hofs `
$ tree /library/books/audiobooks/Hof*
/library/books/audiobooks/Hoffman,\ Donald
`-- The\ Case\ Against\ Reality:\ Why\ Evolution\ Hid\ the\ Truth\ from\ Our\ Eyes\ (2019)
|-- The\ Case\ Against\ Reality\ --\ Cover.jpg
|-- The\ Case\ Against\ Reality\ --\ Part\ 01.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 02.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 03.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 04.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 05.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 06.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 07.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 08.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 09.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 10.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 11.opus
|-- The\ Case\ Against\ Reality\ --\ Part\ 12.opus
|-- The\ Case\ Against\ Reality\ --\ Summary.nfo
`-- metadata.json
/library/books/audiobooks/Hofstadter,\ Richard
`-- Anti-Intellectualism\ in\ American\ Life\ (1963)
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Cover.jpg
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 01.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 02.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 03.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 04.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 05.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 06.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 07.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 08.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 09.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 10.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 11.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 12.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 13.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 14.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 15.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Part\ 16.opus
|-- Anti-Intellectualism\ in\ American\ Life\ --\ Summary.nfo
|-- cover.jpg
`-- metadata.json
1 directory, 20 files
To start with, I begin entering the command followed by ` "Hofs ` and a tab:
/library/books/audiobooks $ mv "Hofs<Tab>
This results in the following being completed:
/library/books/audiobooks $ mv "Hofstadter, Richard"/
If I then try to get tab completion of the subdirectory, i.e., by opening a double quote and starting to type Anti followed by tab, the result here is the issue.
start with: /library/books/audiobooks $ mv "Hofstadter, Richard"/
enter: "Anti<tab>
the result is
$ mv "Hofstadter, Richard"/"Hofstadter, Richard/Anti-Intellectualism in American Life (1963)"/
What I expect is:
$ mv "Hofstadter, Richard"/"Anti-Intellectualism in American Life (1963)"/
OR
$ mv "Hofstadter, Richard/Anti-Intellectualism in American Life (1963)"/
but not to have the wrong parent directory left on the entry line.
If there's a better way to demonstrate what's going on, please let me know.
this is on Ubuntu 22.04.
This has always failed any time I can remember trying it with Ubuntu/bash.