The tcolorbox manual shows a nice example of prepending a command prompt on every line of a shell input (page 317), but it apparently only works for the listings library. Is there a similar option for the minted library? I searched through the manual for minted, but the only option I found that might offer this option was the formatcom option… but I don't think that is going to work.
For the record, I would be fine with the output in this answer, but I
- can't figure out how to format this inside the definition for a
\newtcblisting(color, font weight, etc.), and - don't want to have to include my prompt info on every line throughout my file.
My current MWE is as follows:
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{minted}
\newtcblisting{bashinput}[1][]{
listing engine=minted,
minted language=bash,
minted options={
fontsize=\small,
breaklines,
autogobble,
numbersep=2mm},
listing only,
,#1}
\begin{document}
\begin{bashinput}
user ~$ vi /etc/sysconfig/network
user ~$ grep Dipole file-name -A1 | tail -n1 | awk '\{print \$8\}'
\end{bashinput}
\end{document}
Ideally, I could just add a line after listing only, containing something like every listing line={\textcolor{red}{\small\ttfamily\bfseries ~$}}
