There are horizontal gaps in my listings code block when I change the background color. This minimal working example code and screenshot demonstrate the issue.
\documentclass{article}
\usepackage{xcolor}
\usepackage{listings}
\lstset{
basicstyle=\linespread{0.67}\ttfamily,
backgroundcolor=\color{gray}
}
\begin{document}
\begin{lstlisting}
n := 42;
for i in [1,2,3,4,5] do
n := n+i;
od;
\end{lstlisting}
\end{document}
I know a linespread of ⅔ is ridiculous, I'm just accentuating the problem with this example. The real issue is that these gaps appear, albeit very faintly, even for a linespread of 1!
What's going on here and how can I fix this?



