does Bitcoin Core automatically use reindex when you specify txindex=1 with existing sync'd chain? I sync'd a bitcoin node with Bitcoin Core Qt GUI. Hundreds of GB, naturally.
I realized I needed txindex on for Lightning node stuff, so I changed the conf file via the GUI to include txindex=1. I launched it on my Mac and then slapped myself in the face - how would I tell it to reindex instead of throwing away my database?? Didn't wanna download all those GB again.
But then I noticed debug.log started saying this:
2020-11-30T06:07:43Z Syncing txindex with block chain from height 498564
2020-11-30T06:08:28Z Syncing txindex with block chain from height 500148

which, if I remember right means it's doing a reindex, not a full-blown restart of a sync. Checked on disk, and indeed, files still there.
I'm grateful, but also mystified. Questions:

does Bitcoin Core see when you're about to throw away a full sync with txindex=1 and then inject a -reindex into the start command?
how can I see the startup command that bitcoin-qt uses when I start with with the Mac OSX launcher?
Changing the txindex setting no longer requires a reindex since version 0.17.0 (see https://bitcoincore.org/en/releases/0.17.0/, under &quot;Transaction index changes). It'll update just the txindex itself whenever it's out of sync automatically.
So:

It doesn't inject a reindex (which would cause throwing away the entire chainstate database, and rebuilding it). It just detects the txindex is out of date, and scans the unindexed part of the chain in the background.

The command is &quot;bitcoin-qt&quot;, almost certainly, with nothing more.