My plan was to insert a long zip in the side seam of soft fabric pants, then once your recovery period is over, it's easy enough to remove the zip and stitch the seam closed. Knee length pants would be OK with a shorter zip, as it's really only needed (imho) to access the knee for dressing changes etc.
Generally when I want/need a long zip I use the by-the-metre zips, just check how many slides are included.
Don't forget to allow additional width (for swelling) in the knee area of any pants, this can also be reduced later, if required. In fact when I make jeans, I know my left knee is always more swollen than the right, so I make the left leg a little wider around the knee area. It's not noticeable, but makes my jeans more comfortable and the leg doesn't hang up on the L knee.
Good luck with your surgery. ;-)