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

Is it possible to have a two line prompt?

Discussion in 'TCC/LE Support' started by jason404, Nov 30, 2012.

  1. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
    Is it possible to have a two line prompt in TCC/LE, like in bash?

    I think this is desirable when in a long directory path.

    If not, is it possible in TCC? I saw the Help page for ANSI X3.64, which suggests it might be.
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Yes, in both TCC/LE and TCC. In fact on my laptop I have a 3-line prompt:
    line 1 - battery information (AC charging or not; available charge)
    line 2 - operating environment (date and time, OS, current user, starting hotkey (stand-alone only), home drive, command processor version/build)
    line 3 - CWD
    On desktop line 1 is absent.
    The same batch file generates the complete prompt on all of my systems. The 3 elements which can change during the life of a single instance of the command processor are date, time, and default directory, each of which is supported explicitly by the special characters listed in the HELP for the PROMPT command.

    Note that ANSI X3.64 is only relevant if it is enabled in the .INI file (see OPTION command); I only use it to color-code the fields in line 2 so they could be easily discerned.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    Yes. Use the meta-character "$_" in your prompt to produce a CR/LF pair.
     
  4. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    559
    Likes Received:
    7
    My prompt is two lines and multi-color. First line is working directory, second line is time and $ (dollar sign) like bash.
    Code:
    PROMPT=$e[32;2m[$P]$_$e[35;1m$t$s$$$e[0m$s
     
  5. mfarah

    Joined:
    Nov 2, 2009
    Messages:
    226
    Likes Received:
    5
    Add a $_ to your prompt variable to break up the prompt in two lines.
     
  6. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
    Thanks for the replies.

    Before I asked I had already tried similar things to what was suggested, but I did not have the ANSI Colors option selected in Option\Windows\Colors

    I'm now using this prompt, which is a Windows version of my bash prompt, but without git branch info.
    Code:
    PROMPT=$e[32m%%USERDOMAIN\$u$s$e[33;2m$P$_$e[35;1m$g$e[0m$s
     

Share This Page