When Mayor Bill de Blasio scored a two-year extension of mayoral control last week, it looked like a defeat for Senate Majority Leader John Flanagan, who wanted perks for charter schools included in the bargain.

But charter schools’ hopes may not be dashed yet. The New York Post reported that a deal to expand the charter school sector is on the way. City Hall confirmed that to Chalkbeat on Wednesday.

“I’ll be able to provide more information on the deal in the coming days,” Freddi Goldstein, a spokeswoman for the mayor’s office, said in an email.

What will the final deal look like? Past fights between charter school advocates and the de Blasio administration could provide clues.

One perennial feud between de Blasio and charter school advocates is over space in the city’s public school buildings — one of the only ways de Blasio can exert any control over the charter sector. In 2014, charter advocates won a big legislative victory that required New York City to provide new or expanding charter schools with public space or help them pay rent in private buildings.

Charter advocates say city officials have made the process more cumbersome than necessary by repeatedly denying them space and prompting an appeals process. In an open letter sent to de Blasio last fall, several charter leaders said securing space for their schools has involved “unnecessary hurdles, difficulties and delays.”

In reports by the pro-charter group Families for Excellent Schools, charter school leaders explained some of the main concerns. One complaint is that the city forces charter schools into private space instead of providing public space, which is often preferred by charter school leaders, since private space is hard to find and can be costly to maintain. Another is that schools aren’t always given enough space to account for future enrollment.

Since 2014, 36 charter schools have received offers for public space and 108 have not, according to city officials. Of the 108 schools that have been denied, 93 have gone through a successful appeals process and are now receiving or will receive rental assistance.

Families for Excellent Schools has argued, by examining which buildings could house additional students, there is plenty of public space available for charter schools. The city has said it is not that simple, and that analyzing only available seats does not take into account the type of space left or whether there are projected changes to a building’s enrollment.

“The DOE complies with State law and carefully evaluates each request from charter schools to provide space if it’s available or assistance to lease private space for schools that qualify,” said education department spokesman Michael Aciman.