I would never try to fix that, since if it fails, it can go right into the motor - I might try to fix the top end, but cables are not expensive enough to bother with all that work.
I just measured a standard cable & with cable off bike & elbow-adjuster all the way in, the inner sticks out 3 inches.