How to show terminal/shell code snippets in Sphinx?

For Linux console commands you could use bash or sh:

.. code-block:: bash

   $ ls -lsa .
   $ make file

Highlighting wouldn't probably work right all the time, but at least you give it a chance.

You can also set the default highlighting in the beginning of the file if you use the @Bonlenfum way with double colons:

.. highlight:: sh

.. code-block:: console

is meant for interactive sessions. Bash or sh didn't work for me.

( from http://build-me-the-docs-please.readthedocs.org/en/latest/Using_Sphinx/ShowingCodeExamplesInSphinx.html#pygments-lexers )