Description of problem:
Command prefixed with a spaces does not appear in history.
# rpm -q bash
# rpm -q bash
# history | tail -n 2
172 rpm -q bash
173 history | tail -n 2
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. execute command from a bash shell prefixed with a spaces:
2. And see that it does not appear in bash history:
executed command (here ls) does not appear in the history
executed command is in the history
I can confirm the problem is in rawhide. But in F11 (with bash-4.0.28) I can't reproduce it.
This can be controlled by HISTCONTROL shell variable. For more you can look at man page of bash.
*** Bug 542184 has been marked as a duplicate of this bug. ***
Ah, the problem is that /etc/profile has changed (as a result of bug #500819) to make this horrid behaviour happen by default.
That change seems like it was a bad idea.
Reopening bug and assigning to setup.
I wouldn't call it regression, maybe just changing the defaults. HISTCONTROL="ignoreboth" is default on other relevant Linux distros - so I wouldn't call it horrid. Sometimes HISTCONTROL=ignorespace might be intentional E.g. midnight commander uses HISTCONTROL="ignorespace" to hide some commands sent to bash by subshell.
I had a discussion with the guy who reported #500819, because initially I thought about adding just ignoredups. Maybe I could change it to
if [ "$HISTCONTROL" = "ignorespace" ] ; then
as I see ignoredups useful - and it doesn't break midnight commander behaviour with ignorespace - and will show your space prefixed commands in history in normal shell.
I'm not that keen on ignoredups either, although it's not quite as bad as ignorespace. It breaks long-established use patterns where you have a bunch of commands, some of which may be repetitions, and you can repeat them all, repeatedly, by hitting <UP> <UP> <UP> <UP> <UP> <ENTER>, for example.
I really don't think we should have changed the default at all. Midnight commander can set what it likes anyway, can't it? As can users who want different behaviour.
I don't like if one distribution has unnecessarily default X, second one has default Y, third has default Z. From what I have seen, ignoreboth/ignoredups is used as default on quite a big number of Linux systems. They usually enabled ignoredups and then after complains from mc users they enabled ignoreboth. This "if expression" should handle this - so no need for that.
Defaults in various distros:
Debian: ignoreboth (because of mc, it was ignoredups before)
Ubuntu: ignoreboth (because of mc, it was ignoredups before)
OpenSuse: ignoreboth (afaik, bacause of mc, before it was ignoredups)
Gentoo: ignoreboth (afaik)
Everyone could change the behaviour on his machine easily, so you could change files in your home directory only and you are done. As the ignoreboth was usually added because of mc (and that's solvable other way), I tend to keep ignoredups - as anyone could disable it and it keeps the shell behaviour consistent on most of Linux distros.
Ok, changed to the style from comment #5 - fixed in RAWHIDE - setup-2.8.11-1.fc13, closing.