About a month ago, I started noticing that my Xcode has been possessed. I would finish the work, close the lid on the MBP for the night, then next day when I would want to continue, I would notice every so often that Xcode is not at all the way I left it - it would jump to some totally different class (often times a system class that I know I wasn't looking at all), and bunch of lines of code would become commented-out, so I would have to undo the damage. In some cases, it seemed like even the system classes would have commented-out lines, and there were two times where I couldn't figure out what system classes were damaged, so I had to reinstall Xcode.
I double checked that I didn't have a bluetooth keyboard getting connected to the laptop, and doing random keypresses - it wasn't that. My only external BT keyboard was switched off completely, and didn't even have batteries in it.
After some time it dawned on me what was happening: TouchBar in Xcode has two buttons in the middle of the strip: One is to comment-out the code "//" and the other is to jump to a definition. Somehow, these two buttons were being pressed all on their own while the laptop lid is closed, and that would explain for all the nonsense that was happening. Since then, I've removed those buttons from the strip in Xcode, and sure enough, the problem has stopped. But still, I obviously don't want this happening. In the finder, I used to have a trashcan button on that spot in touchbar! It could be deleting the files from the folder I left it, without me ever knowing. I removed the potentially problematic buttons from everywhere I could think of - but how could something like this be happening in the first place? I tried resetting the PRAM and SMC btw, that didn't stop the problem. This doesn't seem like a known issue - I couldn't find anything anywhere about it, so I figured I'll ask about it here to see if anyone else has seen it, and to help others who potentially experience it. I'm clueless as to when exactly the buttons are being pressed or how. I know that touchbar turns off when the lid is closed. Maybe during the time capsule backup over the night, the machine wakes up, and this happens then? I wonder if Apple would cover this problem under their extended keyboard warranty that they apply to 2016 and 2017 MBP models? Of course, I'd have significant problems proving that the problem exists in the first place :\
I double checked that I didn't have a bluetooth keyboard getting connected to the laptop, and doing random keypresses - it wasn't that. My only external BT keyboard was switched off completely, and didn't even have batteries in it.
After some time it dawned on me what was happening: TouchBar in Xcode has two buttons in the middle of the strip: One is to comment-out the code "//" and the other is to jump to a definition. Somehow, these two buttons were being pressed all on their own while the laptop lid is closed, and that would explain for all the nonsense that was happening. Since then, I've removed those buttons from the strip in Xcode, and sure enough, the problem has stopped. But still, I obviously don't want this happening. In the finder, I used to have a trashcan button on that spot in touchbar! It could be deleting the files from the folder I left it, without me ever knowing. I removed the potentially problematic buttons from everywhere I could think of - but how could something like this be happening in the first place? I tried resetting the PRAM and SMC btw, that didn't stop the problem. This doesn't seem like a known issue - I couldn't find anything anywhere about it, so I figured I'll ask about it here to see if anyone else has seen it, and to help others who potentially experience it. I'm clueless as to when exactly the buttons are being pressed or how. I know that touchbar turns off when the lid is closed. Maybe during the time capsule backup over the night, the machine wakes up, and this happens then? I wonder if Apple would cover this problem under their extended keyboard warranty that they apply to 2016 and 2017 MBP models? Of course, I'd have significant problems proving that the problem exists in the first place :\
Last edited: