I find that Claude does this much more than other models. GPT, for instance, knows I'm on Windows running PowerShell, and writes very idiomatic PowerShell.
But maybe that's because I'm the sucker, and since PowerShell is more verbose it costs me more tokens than the terseness of Unix shells. Oh well.
Some models are better than others. But it's all fixable with a relatively small skill. Try PowerShell Windows Skill perhaps.