% Use a nicer-Looking design for the TOC
\usepackage{tocstyle}
\usetocstyle{KOMAlike}

% Avoid typographical unpleasantries
\clubpenalty = 10000
\widowpenalty = 10000
\displaywidowpenalty = 10000
% Avoids line-overshooting at the cost of "Word-like" spacing
\setlength{\emergencystretch}{0.25em}

\usepackage{scrhack}
\usepackage{listings}
\lstnewenvironment{shell}[1]{
   \endgraf
%   \singlespacing
   %\renewcommand\lstlistingname{Example}
   \lstset{
      columns=fullflexible,
      language=bash,
      showstringspaces=false,
      basicstyle=\ttfamily,
      backgroundcolor=\color{gray!50},
      keywordstyle=\color{black},
      commentstyle=\color{black},
      stringstyle=\color{black},
      captionpos=b,
      numbers=none,
      tabsize=4,
      breaklines=true,
      breakatwhitespace=true,
      %escapeinside={\%*}{*)},
      escapeinside={(*@}{@*)},
      escapechar='',
      frame=float,
      %float=h,  % don't do page breaks
      #1}
}{}

