I successfully got rid of them in a pot once by adding a bit of hydrogen peroxide to the watering can and then covering the entire surface with bird grit.
Confidence is that feeling you have right before you do something really stupid.
I need to write that down. I refuse to grow houseplants because I'm bad at it, but mostly because I hate gnats. Can't really grow them now because of the dogs, but I'm sure I'll get some in the greenhouse.