I used to be able to scroll using the trackpad through git diff or man pages which both use less when the output doesn't fit on screen. Today I restarted my computer and that behaviour is gone and I can no longer scroll down and if I scroll up it scrolls the terminal scrollbar showing previous commands. However in vim scrolling still works as expected.
The first thing I checked is the "Scroll alternate screen" Terminal setting and it is checked as expected. I also tried with iTerm2 and have the same issue even with the "Scroll wheel sends arrow keys when in alternate screen mode" setting enabled.
My default shell is zsh so I tried with bash and then sh. Both have the same behaviour and I can't scroll through the output.
Because scrolling still works with some commands like vim it seems like the issue might be that less is no longer recognized as an "alternate screen" but I have no idea why. Updating to the latest less version available on brew did not help.