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

PROMPT2

Discussion in 'Support' started by vefatica, Jun 10, 2011.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,079
    Likes Received:
    30
    I can't get PROMPT2 to work.
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,079
    Likes Received:
    30
    On Fri, 10 Jun 2011 11:40:01 -0400, vefatica <> wrote:

    |I can't get PROMPT2 to work.

    It only works in some situations.

    Code:
    v:\> set prompt2
    $g$s
    
    v:\> echo foo &^
    
    [quote]> echo bar
    [/quote]
    foo
    bar
    
    v:\> (echo foo
    More? echo bar
    More? )
    foo
    bar
    
    v:\> do i=1 to 2 (
    More? echo foo )
    foo
    foo
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    As the help says, PROMPT2 is only used when the last character on the line
    is an escape character. Your unclosed command groups do not have a trailing
    escape character.
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,079
    Likes Received:
    30
    On Fri, 10 Jun 2011 12:49:03 -0400, rconn <> wrote:

    |---Quote---
    |> |I can't get PROMPT2 to work.
    |>
    |> It only works in some situations.
    |---End Quote---
    |As the help says, PROMPT2 is only used when the last character on the line
    |is an escape character. Your unclosed command groups do not have a trailing
    |escape character.

    It would be nice if it simply replaced the "More?" prompt.
     
  5. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    559
    Likes Received:
    7
    It doesn't say that it is only used when escape is the last character. It says...
    ... and then gives an example of the the last character being the escape...
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,358
    Likes Received:
    39
    Obnoxiously trivial grammar nit; feel free to tune out:

    i.e. = "that is"
    e.g. = "for example"

    So the parenthetical bit is defining the phrase "line continuations", not giving an example. (It is missing a close pat, though.)
     
  7. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,201
    Likes Received:
    11
    To be fair, I.E. means "in other words."
    E.G. means "for example"

    -Scott




    Quote:


    Originally Posted by rconn

    As the help says, PROMPT2 is only used
    when the last character on the line
    is an escape character. Your unclosed command groups do not have a trailing
    escape character.
    It doesn't say that it is only used when
    escape is the last character. It says...
    Quote:


    PROMPT2 defines the prompt used
    for line continuations
    ... and then gives an example of the the
    last character being the escape...
    Quote:


    (i.e., when the last character
    on a line is an escape character. The default is "More? ".
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    I think you're trying to redefine the meaning of "i.e." to be the same as "e.g.". The last character being an escape is not an example, it's a requirement.
     
  9. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,079
    Likes Received:
    30
    On Fri, 10 Jun 2011 16:16:40 -0400, rconn <> wrote:

    |I think you're trying to redefine the meaning of "i.e." to be the same as "e.g.". The last character being an escape is not an example, it's a requirement.

    In effect the two (escaped newline and unresolved parens) are the same ...
    command input continues on a sebsequent line with a different prompt to remind
    the user of what's going on. Would it be difficult to make the behavior
    consistent?
     
  10. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    559
    Likes Received:
    7
    Just trying to help...
     
  11. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    It may appear the same to you, but to the parser they're about as similar as
    a fish and a banana.

    I'll look at it again, but it is not trivial.
     
  12. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,079
    Likes Received:
    30
    On Fri, 10 Jun 2011 17:26:02 -0400, rconn <> wrote:

    |---Quote---
    |> In effect the two (escaped newline and unresolved parens) are the
    |> same ... command input continues on a sebsequent line with a
    |> different prompt to remind the user of what's going on. Would it be
    |> difficult to make the behavior consistent?
    |---End Quote---
    |It may appear the same to you, but to the parser they're about as similar as
    |a fish and a banana.
    |
    |I'll look at it again, but it is not trivial.

    The actual writing of the string is all that would seem to matter. The escaped
    newline (apparently) causes ShowPrompt(L"PROMPT2"); I'm not sure what the
    unresolved paren causes to happen.
     
  13. Steve Pitts

    Joined:
    Jul 7, 2008
    Messages:
    159
    Likes Received:
    0
    {Start GrammarNazi mode}
    Being anally retentive, Charles is perfectly correct in defining i.e. as 'that is', which is the literal translation of the Latin 'id est' from which the abbreviation derives. It always bugs me when folk use i.e. and e.g. interchangeably and here we seem to have fallen foul of the opposite, i.e. assuming that the help was giving an example rather than defining the only valid situation, despite the text actually being to the contrary. This is why this stuff does matter, even in the age of the text and the tweet, because when someone uses a term properly we have a knee-jerk reaction that they've actually done so incorrectly.
    {End GrammarNazi mode}
     
  14. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,358
    Likes Received:
    39
    Um, thanks. I think.
     
  15. Steve Pitts

    Joined:
    Jul 7, 2008
    Messages:
    159
    Likes Received:
    0
    ;)
     
  16. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,079
    Likes Received:
    30
    I see you did it. Thanks! Was it hard?
     

Share This Page