Welcome!

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

SignUp Now!

Done Proposal: new PROMPT $i special command.

Nov
344
10
I move around my laptop quite a bit, connecting it to several networks (work, home, mistress' home :p, etc.), and each time it gets assigned a different IP address.

My current prompt says somewhere ... $u@%_ip ... , but the problem with this is that %_ip gets evaluated only at the window startup, and if I move to a new network, the old IP address will still be there. A workaround is to simply close that TCC window and open another one, but there are many times where this is undesirable.

I'd like to have the new special command $i available for the prompt: it will display the current IP address(es), just like the %_ip variable does.

Thanks.

(It's been a while since I last participated - I apologize if this has been flogged to death before)
 
I move around my laptop quite a bit, connecting it to several networks (work, home, mistress' home :p, etc.), and each time it gets assigned a different IP address.

My current prompt says somewhere ... $u@%_ip ... , but the problem with this is that %_ip gets evaluated only at the window startup, and if I move to a new network, the old IP address will still be there. A workaround is to simply close that TCC window and open another one, but there are many times where this is undesirable.

Try this:

Code:
prompt $u@%%_ip $g
Or this:

Code:
prompt `$u@%_ip $g`
Either way will store the literal string %_ip in the PROMPT variable to be evaluated when the prompt is displayed.
 
Try this:

Code:
prompt $u@%%_ip $g
Or this:

Code:
prompt `$u@%_ip $g`
Either way will store the literal string %_ip in the PROMPT variable to be evaluated when the prompt is displayed.

I tried the first method and it worked perfectly. Thank you.

I guess it's time for me to reread the manual from scratch. :o
 
Back
Top
[FOX] Ultimate Translator
Translate