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

Proposal: new PROMPT $i special command.

Discussion in 'Suggestions' started by mfarah, Nov 24, 2010.

  1. mfarah

    Joined:
    Nov 2, 2009
    Messages:
    226
    Likes Received:
    5
    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)
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    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.
     
  3. mfarah

    Joined:
    Nov 2, 2009
    Messages:
    226
    Likes Received:
    5
    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
     

Share This Page