NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/52458: \n in prompt breaks history mechanism in /bin/sh



>Number:         52458
>Category:       bin
>Synopsis:       \n in prompt breaks history mechanism in /bin/sh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 03 01:25:00 +0000 2017
>Originator:     Ian D. Leroux
>Release:        NetBSD 8.99.1 amd64
>Organization:
>Environment:
NetBSD scrameustache.unrouted.net 8.99.1 NetBSD 8.99.1 (GENERIC) #3: Sun Jul 30 17:08:46 EDT 2017  idleroux%scrameustache.unrouted.net@localhost:/build/src/sys/arch/amd64/compile/obj/GENERIC amd64
>Description:
In /bin/sh with command-line editing enabled (either with 'set -o vi' or 'set -o emacs', or one of the equivalent commands), one can normally cycle back through previously entered commands one by one using 'k' in vi command mode, or Ctrl-P (or up-arrow) in emacs mode.

However, if $PS1 contains a newline, the commands are not recorded separately but rather as a single block of text, and attempting to go back to a previous command reloads the entire command history as a single  script, rather than as a series of individually selectable commands.

The problem was introduced recently, in that a system from 2017-06-18 does not exhibit this behavior, while one from 2017-07-30 does.
>How-To-Repeat:
/bin/sh
PS1='
$ '
# run a few example commands, e.g.
ls
date
uname
# now attempt to view history,
# either with ESC-k in vi mode or with Ctrl-P in emacs mode,
# and note that all preceding commands appear as a block.
>Fix:



Home | Main Index | Thread Index | Old Index