I've noticed while creating an exercice for my students that although Illustrator keeps lines straight when you hold down "Shift", the software overrides this when closing a shape. For example, if I trace a rectangle holding Shift but my last line is not properly aligned with the closing point, Illustrator will allow me to trace the path and close the shape even if I'm holding Shift, resulting in a bent path.
Here are some examples both created while holding Shift:
I see a lot of students struggling with this when starting with the pen tool. Is there a setting or tolerance somewhere that could give a warning or keep this from happening?
I know there can be a bunch of workarounds to align the path after the fact, but I'm looking to prevent the issue altogether.