This paper presents a search for hypothetical massive, charged, long-lived particles with the ATLAS detector at the LHC using an integrated luminosity of 139 fb$^{-1}$ of proton-proton collisions at $\sqrt{s}=13$ TeV. These particles are expected to move significantly slower than the speed of light and should be identifiable by their high transverse momenta and anomalously large specific ionisation losses, ${\mathrm{d}}E/\mathrm{d}x$. Trajectories reconstructed solely by the inner tracking system and a ${\mathrm{d}}E/\mathrm{d}x$ measurement in the pixel detector layers provide sensitivity to particles with lifetimes down to ${\cal O}(1)$$\text{ns}$ with a mass, measured using the Bethe--Bloch relation, ranging from 100 GeV to 3 TeV. Interpretations for pair-production of $R$-hadrons, charginos and staus in scenarios of supersymmetry compatible with these particles being long-lived are presented, with mass limits extending considerably beyond those from previous searches in broad ranges of lifetime.
A search for the electroweak production of pairs of charged sleptons or charginos decaying into two-lepton final states with missing transverse momentum is presented. Two simplified models of $R$-parity-conserving supersymmetry are considered: direct pair-production of sleptons ($\tilde{\ell}\tilde{\ell}$), with each decaying into a charged lepton and a $\tilde{\chi}_1^0$ neutralino, and direct pair-production of the lightest charginos $(\tilde{\chi}_1^\pm\tilde{\chi}_1^\mp)$, with each decaying into a $W$-boson and a $\tilde{\chi}_1^0$. The lightest neutralino ($\tilde{\chi}_1^0$) is assumed to be the lightest supersymmetric particle (LSP). The analyses target the experimentally challenging mass regions where $m(\tilde{\ell})-m(\tilde{\chi}_1^0)$ and $m(\tilde{\chi}_1^\pm)-m(\tilde{\chi}_1^0)$ are close to the $W$-boson mass (`moderately compressed' regions). The search uses 139 fb$^{-1}$ of $\sqrt{s}=13$ TeV proton-proton collisions recorded by the ATLAS detector at the Large Hadron Collider. No significant excesses over the expected background are observed. Exclusion limits on the simplified models under study are reported in the ($\tilde{\ell},\tilde{\chi}_1^0$) and ($\tilde{\chi}_1^\pm,\tilde{\chi}_1^0$) mass planes at 95% confidence level (CL). Sleptons with masses up to 150 GeV are excluded at 95% CL for the case of a mass-splitting between sleptons and the LSP of 50 GeV. Chargino masses up to 140 GeV are excluded at 95% CL for the case of a mass-splitting between the chargino and the LSP down to about 100 GeV.