1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Attaching PowerShell changes its colors and makes it hard to read

Discussion in 'Support' started by cwc, Mar 9, 2010.

  1. cwc

    cwc

    Joined:
    Mar 9, 2010
    Messages:
    11
    Likes Received:
    0
    I'm a newbie to Take Command, and I'm still learning my way around.

    I opened a PowerShell window outside of Take Command, then attached it to TC inside a tab. The default PowerShell colors of white on blue were turned into some shade of gray on magenta, which is very difficult to read.

    Is there a way to keep the original colors when I attach an independently launched console window, PowerShell or otherwise?
     
  2. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    Attaching PowerShell changes its colors and makes it hard to read

    TCC 11.00.41 Windows XP [Version 5.1.2600]
    TCC Build 41 Windows XP Build 2600 Service Pack 3

    Mine stayed the same white on blue color as expected.

    On Tue, Mar 9, 2010 at 9:22 AM, cwc <> wrote:




    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    PowerShell is redefining the console color palette for its window. Take
    Command will detect this when launching an app in a tab window, but it was
    not detecting it when you attach a tab. I've added that to build 42
    (already uploaded).

    Rex Conn
    JP Software
     
  4. cwc

    cwc

    Joined:
    Mar 9, 2010
    Messages:
    11
    Likes Received:
    0
    I downloaded and installed build 42, and the problem still persists. PowerShell's white on blue turns into gray on magenta.
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Not reproducible here with build 42 (either 32 or 64 bit), in either Windows
    2008 or Windows 7.

    Anybody else able to reproduce this with build 42?

    Rex Conn
    JP Software
     
  6. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    Attaching PowerShell changes its colors and makes it hard to read

    Does this require Windows 2008 / Windows 7? I can't reproduce the problem
    under XP.

    On Tue, Mar 9, 2010 at 9:22 AM, cwc <> wrote:




    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     
  7. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    Attaching PowerShell changes its colors and makes it hard to read

    On Wed, Mar 10, 2010 at 8:03 AM, Jim Cook <jimrcook@gmail.com> wrote:


    I meant to add, using build 41 I can't reproduce the problem in the first
    place, so it seems pointless to try 42 until I can see a difference happen.
    How do I reproduce the problem in 41?





    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    First, doublecheck to make *sure* you're running TCMD build 42 (Help/About).

    If you're definitely running 11.0.42, what version of Windows are you
    running, and are you using the 32 or 64 bit version of Windows, and the 32
    or 64 bit version of Take Command?

    Rex Conn
    JP Software
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Attaching PowerShell changes its colors and makes it hard to read

    Reading the remapped console color palette is only supported in Vista / 2008
    / 7.

    In XP, Take Command will read the console color palette from the registry
    (HKCU\Console\ColorTable).

    Rex Conn
    JP Software
     
  10. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    Attaching PowerShell changes its colors and makes it hard to read

    I have a Win7 box on my test bench just now. If somebody will give me
    directions on how to reproduce the b41 problem, I'll test b41 & b42.

    On Wed, Mar 10, 2010 at 9:59 AM, rconn <> wrote:




    --
    Jim Cook
    2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Monday.
     
  11. cwc

    cwc

    Joined:
    Mar 9, 2010
    Messages:
    11
    Likes Received:
    0
    Here's what I'm running, as pasted in from the TCC signon:
    TCC 11.00.42 Windows XP [Version 5.1.2600]

    My version of Windows is 32-Bit.

     
  12. cwc

    cwc

    Joined:
    Mar 9, 2010
    Messages:
    11
    Likes Received:
    0
    Re: Attaching PowerShell changes its colors and makes it hard to read

    In my registry, under HKCU/Console:

    ColorTable05 has the value 0x00800080 — Purple.
    ColorTable06 has the value 0x00008080 — Olive.

    On my system, these are the respective background and text colors that a PowerShell window takes on when it is attached.

    I don't remember ever setting either of these colors for any console window.

    I'm running Take Command 11.00.42 on Windows XP [Version 5.1.2600], as pasted in from the TCC signon.
     
  13. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Re: Attaching PowerShell changes its colors and makes it hard to read

    OK, there are two problems here.

    First, XP does not support the Windows API that allows Take Command to
    automatically mimic the colors of every attached console. No way around
    that without updating to a less ancient version of Windows.

    Second, although you have a custom color table, it's set to the default
    values (5 = Magenta, 6 = Yellow), so Take Command is using that when
    attaching the console. If you change those two values to 0x562401 and
    0xf0edee respectively, you'll get the colors that PowerShell is using.
    (This also means you won't be able to display the (non-bright) magenta or
    yellow in your console windows, but that may not be a big loss for you.)

    Rex Conn
    JP Software
     
  14. cwc

    cwc

    Joined:
    Mar 9, 2010
    Messages:
    11
    Likes Received:
    0
    Re: Attaching PowerShell changes its colors and makes it hard to read

    That's a reasonable workaround until I can get onto Windows 7 — Thanks, Rex, and also Jim for your efforts in trying to reproduce the problem.

     
  15. jjp

    jjp

    Joined:
    Sep 8, 2016
    Messages:
    1
    Likes Received:
    0
    I know this thread is old as dirt, but this issue is incredibly irritating. I can't believe noone else is complaining about it. I tried a trial version of the latest released version and the issue persists. I can repro by launching powershell, then just running tcc.exe from within powershell. This is particularly problematic when tcc is handling .bat files.

    Windows 10 x64 build 1607
     
  16. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    This is actually a PS bug, not a TCC bug. However, since Microsoft is unlikely to provide a timely fix, I can probably hack something to determine whether ps.exe is the parent process and if so overwrite the incorrect registry values.
     

Share This Page