I assume you dont mean when I am the pilot flying a rented aircraft (then it would be shorts and a tee shirt in summer and jeans and a sweatshirt when cooler).
I just flew for work this morning. Jeans and a golf shirt with running sneakers. I have a TSA belt (the buckle is plastic) so I dont have to take that off when I go through security. I used to think wearing dress shoes and packing the sneakers was a good idea, but the dress shoes set off the metal detector. This morning I went through the pre-check line at 5am, so it took less than a minute and I was off to my gate.
I was flying to Miami this weekend. And I looked around me. In the morning, at a Starbucks, I saw a guy with a 4-5inchbinseam short sitting outside. At the airport, at least one guy was wearing a 5inch short. No one even cared.
I do have one. I will wear it on my way back.
In Miami. I tried to wear a denim short 2 inch. No one cared. Form hotel to beach or public transport. Great feeling.
But yes, 2 inch would way too short for flying.