It’s such a great moment! The fake line that was put in there just to try and keep the secret was “You don’t know the truth: Obi-Wan killed your father!” But as much as I enjoyed leaking false information, it was a wonderfully hard secret to keep because (Irvin) Kershner, the director, brought me aside and said “Now I know this, and George knows this, and now you’re going to know this, but if you tell anybody, and that means Carrie or Harrison, or anybody, we’re going to know who it is because we know who knows.”.
-Mark Hamill
They also gave him a fake line to deliver and didn’t reveal that Darth Vader was actually Luke’s father during the filming of that scene: https://www.soundandvision.com/news/100104hamill/