If I specify a custom datadir, why will bitcoin-qt continue to use and download blocks into ~/.bitcoin?

I told bitcoin-qt to use a custom data directory and the blocks in it have been updated as the download progresses.

At a certain point bitcoin-qt was restarted and I didn’t specify that custom directory however the settings indicated it was still using that custom directory.

However I’ve now discovered that it has also been downloading and updating ~/.bitcoin. Why might that be?

Also: when I try specifying that custom data directory path on the command line, it complains about pruning and says will rewrite something and redownload the entire blockchain.

What is the best way to resolve this weird two-directory conundrum?

Currently bitcoin-qt seems to be ignoring ~/.bitcoin, as I wanted. This prints nothing:

$ lsof | grep '.bitcoin'