This paper has three main goals. First, we study fixed subgroups of automorphisms of right-angled Artin and Coxeter groups. If ϕ is an untwisted automorphism of a RAAG, or an arbitrary automorphism of a RACG, we prove that Fix ϕ is finitely generated and undistorted. Up to replacing ϕ with a proper power, we show that Fix ϕ acts properly and cocompactly on a convex subcomplex of the universal cover of the Salvetti/Davis complex. Thus, Fix ϕ is a special group in the sense of Haglund-Wise.By contrast, there exist "twisted" automorphisms of RAAGs for which Fix ϕ is undistorted but not of type F (hence not special), of type F but distorted, or even infinitely generated.Secondly, we introduce the notion of "coarse-median preserving" automorphism of a coarse median group, which plays a key role in the above results. We show that automorphisms of RAAGs are coarse-median preserving if and only if they are untwisted. On the other hand, all automorphisms of Gromov-hyperbolic groups and right-angled Coxeter groups are coarse-median preserving.Finally, we show that, for every special group G (in the sense of Haglund-Wise), every infiniteorder, coarse-median preserving outer automorphism of G can be realised as a homothety of a finite-rank median space X equipped with a "moderate" isometric G-action. This generalises the classical result, due to Paulin, that every infinite-order outer automorphism of a hyperbolic group H projectively stabilises a small H-tree.