Improve macOS terminal text navigation (#2338)