Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Apr 2018 15:26:06 +0100
From:      tech-lists@zyxst.net
To:        freebsd-questions@freebsd.org
Subject:   bash history buffer output mangled after repeated up-arrow
Message-ID:  <20180425142605.GA39933@desktop.local>

next in thread | raw e-mail | index | archive | help
hi,

I've noticed now, for a while (like maybe over a year) that if you're in
bash shell, hitting up-arrow (which usually loads history -1) multiple
times will result in part of history becoming the prompt.

I use csh as login shell now because csh doesn't have this problem.

I can re-create the issue by logging in then doing the following:
% bash
$ . .profile
hit uparrow a few times (in this case, 15 times), it gets to this in its
history:
bzcat /var/log/messages.1.bz2 |less

prompt is now:
[john@desktop ~]$ bzcat /var<--cursor is here waiting for input

[keep hitting up arrow]
now it's [john@desktop ~]$ ls -lah .g[history] where [history] is=20
find /usr/src/sys/sys/param.h -mtime; echo

backspacing to (in this case) [john@desktop ~]$ ls -lah .g (which is as
far as one can backspace on that line) and hitting return, restored the=20
normal prompt position. Repeatedly hitting up-arrow mangles bash
history.

it doesn't happen in csh. Not tried other shells. It only happens on
freebsd boxes (11-stable and later). I've not seen it happen on linuxen=20
(raspabian, mint, ubuntu, centos). It doesn't matter if bash is built from=
=20
source or installed via pkg. Doesn't matter if fdescfs is mounted or not.
It still happens if I create a fresh freebsd-11-stable VM, log into it,
install bash.

Any ideas?
thanks,
--=20
J.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180425142605.GA39933>