\documentclass{article}
\usepackage{listings}
\usepackage{color}
\begin{document}
\definecolor{light-gray}{gray}{0.95}
\lstset{basicstyle=\ttfamily\footnotesize,
backgroundcolor=\color{light-gray}, xleftmargin=0.7cm,
frame=tlbr, framesep=0.2cm, framerule=0pt,
}
\begin{lstlisting}[mathescape]
k = $\lfloor (10\log n \cdot \log\log n)^{1/3} \rfloor$;
k = $\lfloor (4\log n \cdot \log n)^{1/3} \rfloor$;
\end{lstlisting}
\end{document}
produces
An answer to a similar question said that "this line is just an artifact of the viewer". But this line appears in two viewers and various zoom steps. On top of that, one can clearly see that the 1/3
overlaps with the white line. So I do not accept it as a mere artifact anymore.
How could this problem be approached? Is it possible to somehow put another grey layer underneath the lstlisting environment which would "eat up" any white lines?
edit: Is there a solution that would not involve editing every line of the code?