Subject: bin/2139: /bin/sh prompting during interactive entry of command substitution broken
To: None <gnats-bugs@NetBSD.ORG>
From: None <woods@weird.com>
List: netbsd-bugs
Date: 02/27/1996 15:47:07
>Number:         2139
>Category:       bin
>Synopsis:       /bin/sh prompting during interactive entry of command substitution broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 27 16:05:05 1996
>Last-Modified:
>Originator:     Greg A. Woods
>Organization:
	Planix, Inc.
>Release:        NetBSD-1.1
>Environment:
System: NetBSD always 1.1 NetBSD 1.1 (GENERIC) #24: Thu Dec 14 13:52:07 EST 1995 gwr@venus:/home/gwr/work/src/sys/arch/sun3/compile/GENERIC sun3

>Description:
	The interactive behavior of the shell (/bin/sh), specifically
	w.r.t. prompting, when entering multi-line commands with command-
	substitution is broken.  Actual behavior depends on which line
	editing mode the shell is in.  Effectively the PS2 prompt handling
	is not working.  (Note it works fine for quoted input.)

>How-To-Repeat:
	Type multi-line command-substitution commands.

	Here's a cut/paste of two examples in plain mode with vi and emacs
	options both disabled:
		$ `
		laksdjf
		alsdkjf
		`
		> > > laksdjf: not found
		alsdkjf: not found
		$ `
		`
		> $ 
	Note how it almost works with PS2 displayed *after* the second `.

	Here's a cut/paste of an example in emacs mode:
		$ set -o emacs
		$ PS1='emacs edit $ '
		emacs edit $ `
		emacs edit $ asldkfj
		emacs edit $ asdlfkj
		emacs edit $ asdflkj
		emacs edit $ `
		asldkfj: not found
		asdlfkj: not found
		asdflkj: not found
		emacs edit $ 
	Note how PS1 is used instead of PS2....

	Here's a cut/past of an example in vi mode:
		emacs edit $ set -o vi
		emacs edit $ PS1='vi edit $ '
		vi edit $ `
		vi edit $ alskdjf
		vi edit $ asdlkfj
		vi edit $ alsdkfj
		vi edit $ `
		alskdjf: not found
		asdlkfj: not found
		alsdkfj: not found
	Note how PS1 is used instead of PS2....

	Compare the first example with the expected behavior as shown by
	/usr/bin/sh on SunOS-4:
		ttyp1:<woods@very> $ `
		> asdlfkj
		> alskdjf
		> alskdjf
		> `
		asdlfkj: not found
		alskdjf: not found
		alskdjf: not found
		ttyp1:<woods@very> $ 
	Note how PS2 is displayed on each line as expected.

>Fix:
	unknown
>Audit-Trail:
>Unformatted: