PROMPT2

#2
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
 
#4
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.
 
Jan 19, 2011
581
10
Norman, OK
#5
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...
PROMPT2 defines the prompt used for line continuations
... and then gives an example of the the last character being the escape...
(i.e., when the last character on a line is an escape character. The default is "More? ".
 

samintz

Scott Mintz
May 20, 2008
1,270
11
Solon, OH, USA
#7
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? ".
 

rconn

Administrator
Staff member
May 14, 2008
10,550
97
#8
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...
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
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?
 

rconn

Administrator
Staff member
May 14, 2008
10,550
97
#11
> 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?
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
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
To be fair, I.E. means "in other words."
{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}