title: IPython color disappear when taking stdin files
body: <p>This is what I tried initially.</p>
  <pre class="lang-linux prettyprint-override"><code>ipython &lt; runMe.py
  </code></pre>
  <p>then I tried adding a file called main.py and it look something like this:</p>
  <pre class="lang-python prettyprint-override"><code>from IPython import embed
  from traitlets.config import get_config
  c = get_config()
  c.InteractiveShellEmbed.colors = &quot;Linux&quot;
  embed(config=c)
  </code></pre>
  <p>then I tried this:</p>
  <pre class="lang-linux prettyprint-override"><code>python main.py &lt; runMe.py
  </code></pre>
  <p>it runs. but doesn't work. still black and white.</p>
  <p>Then I add this  to main.py:</p>
  <pre class="lang-python prettyprint-override"><code>from IPython.utils import coloransi
  from IPython.core import prompts
  
  termcolors = coloransi.TermColors() # the color table
  # IPython's two color schemes:
  dark = prompts.PColLinux.colors
  light = prompts.PColLightBG.colors
  
  # colors.in_normal affects input code
  dark.in_normal = termcolors.Green
  light.in_normal = termcolors.Blue
  # colors.normal affects output
  dark.normal = light.normal = termcolors.Red
  </code></pre>
  <p>no luck. and it throws some errors too.</p>
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File &quot;main.py&quot;, line 6, in &lt;module&gt;
      dark = prompts.PColLinux.colors
  AttributeError: module 'IPython.core.prompts' has no attribute 'PColLinux'
  </code></pre>
  <p>i get those code at <a href="https://stackoverflow.com/questions/14129278/how-do-i-customize-text-color-in-ipython">this stackoverflow post</a></p>
  <p>I see some other solutions at that same post but they all looks really complicated. Anyone know what is going on or know of a better way of doing this? thank in advance. right now the output look like this:</p>
  <pre class="lang-none prettyprint-override"><code>~/MyProject$ ipython &lt; runMe.py
  Python 3.8.12 (default, Aug 30 2021, 16:42:10) 
  Type 'copyright', 'credits' or 'license' for more information
  IPython 8.3.0 -- An enhanced Interactive Python. Type '?' for help.
  
  In [1]: Automatic calling is: Smart
  
  In [2]: ------&gt; print(&quot;hello world&quot;)
  hello world
  
  In [3]: Do you really want to exit ([y]/n)?
  </code></pre>
  <p>also here's runMe.py:</p>
  <pre class="lang-python prettyprint-override"><code>%autocall 1
  print &quot;hello world&quot;
  </code></pre>