I said engineering, and I meant engineering. Not computer science. See
https://www.aei.org/carpe-diem/table-of-the-day-bachelors-de... to verify that in 2016, just under 21% of engineering degrees were given to women. The figures for the mid 1980s were almost the same. But if you can find figures, in the mid-1960s, engineering degrees were almost exclusively given to men.
The ratios have been fairly constant in recent decades, but vary a lot from degree to apparently related degree. For example around 40% of degrees in mathematics go to women, and that factor of 2 difference from engineering has not changed appreciably since Reagan was President.
Now you are right that women were a large part of early software development. "Computer" used to be a job that was almost exclusively held by women. Who then made the transition from actually being the ones who did the calculations to writing code. (Note, the preponderance of women can be explained by mathematical ability being fairly evenly distributed, but most careers using that ability having been barred to women historically.) See Grace Hopper and Margaret Hamilton for justly famous examples.
However I have noticed that the gender ratio seems to be strongly dependent upon language. Some years ago I worked on a project with a COBOL and a Perl group. The COBOL group was largely women, but Perl was almost all men. I got to see what happened in Perl up close. You had a pretty good balance of men and women getting into web development. But a lot of men went from web development to back end web development into programming. Women were more significantly likely to go to front end, design and product management. And neither I nor the women that I talked to saw discrimination as having been the driving factor.
So why does it happen? Here is my best guess. Between COBOL and more modern languages we have introduced many language features that are hard for most people to get their heads around. For example recursion, pointers, closures, and class hierarchies. These barriers are sufficiently hard that many teachers privately say that only some people are able to learn to program. My suspicion is that one or more of these concepts is more of a barrier for women than men.