Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Is it possible to have a two line prompt?

Mar
30
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.
 
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.
 
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.
Yes. Use the meta-character "$_" in your prompt to produce a CR/LF pair.
 
Is it possible to have a two line prompt in TCC/LE, like in bash?
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
 
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.

Add a $_ to your prompt variable to break up the prompt in two lines.
 
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
 
Back
Top
[FOX] Ultimate Translator
Translate