Global linear stability analysis of open flows leads to difficulties associated to boundaiy conditions, leading to either spurious wave reflections (in compressible cases) or to non-local feedback due to the elliptic nature of the pressure equation (in incompressible cases). A nove( approach is introduced to address both these problems. The approach consists of solving the problem using a complex mapping of the spatial coordinates, in a way that can be directly applicable in an existing code without any additional auxiliaiy variable. The efficiency of the method is first demonstrated for a simple 1D equation modeling incompressible Navier-Stokes, and for a linear acoustics problem. The application to full linearized Navier-Stokes equation is then discussed. A criterion on how to select the parameters of the mapping function is derived by analyzing the effect of the mapping on plane wave solutions. Finally, the method is demonstrated for three application cases, including an incompressible jet, a compressible hole-tone configuration and the flow past an airfoil. The examples allow to show that the method allows to suppress the artificial modes which otherwise dominate the spectrum and can possibly hide the physical modes. Finally, it is shown that the method is still efficient for small truncated domains, even in cases where the computational domain is comparable to the dominant wavelength.* The rev iew of Chis paper was arranged by Prof. N.S. Scocc.