Bug 1025130 - Bash doesn't append to history after each command
Bash doesn't append to history after each command
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ondrej Oprala
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-31 01:10 EDT by lnie
Modified: 2016-01-31 21:09 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-24 08:52:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
output (2.83 KB, text/plain)
2014-05-19 05:03 EDT, lnie
no flags Details

  None (edit)
Description lnie 2013-10-31 01:10:07 EDT
Description of problem:
 No commands left after switch users by "su" 

Version-Release number of selected component (if applicable):
 f20-Beta-TC6 (x86_64)
How reproducible:
 always

Steps to Reproduce:
1.do a fresh install on vm
2.run some commands (cd ,rpm ,yum ..)with user root
3.su lnie and run some commands
4.su root ,when type the"up"/"down"key nothing come up
  (run history,only get one command ,that is :1 history
5.su lnie, the same thing happened
Actual results:


Expected results:


Additional info:
Comment 1 Cole Robinson 2013-10-31 09:51:40 EDT
gnome-applet-vm is not the correct component, please re-assign
Comment 2 Karel Zak 2013-11-01 07:35:26 EDT
Oh, it's probably because the current session is still running and shell does not save the history yet. Don't forget that su(1) starts a new session, but does not end the previous -- see for example "ps auf".

Anyway, it's not related to su(1). Re-assigning.
Comment 3 lnie 2013-11-03 23:51:21 EST
still with f20-beta-RC2
Comment 4 lnie 2013-11-15 00:44:11 EST
still occurs with f20-final-TC1
Comment 5 lnie 2013-12-11 04:49:31 EST
(In reply to lnie from comment #4)
> still occurs with f20-final-TC1

Still persists in f20-final-TC5.
Really a big problem for those who used to using "up"+"down" keys,or "hostory"command ,or"ctrl+r".
It seems that the system try to remember things optionally,
for example, if I do "yum install xchat",and "yum install libvirt",it may only
able to remember doing "yum install xchat" after "su"
Comment 6 Ondrej Oprala 2014-05-19 04:02:20 EDT
Hi, and thanks for the report.
I'd like to see your results of the "printenv" command (when logged in as root, ofc).
Comment 7 lnie 2014-05-19 05:02:42 EDT
Sure,the output is attached
Comment 8 lnie 2014-05-19 05:03:09 EDT
Created attachment 897056 [details]
output
Comment 9 Ondrej Oprala 2014-06-11 07:41:48 EDT
Sorry for the late reply.

There are two things affecting this behaviour.
Firstly, make sure "shopt -o histappend" is somewhere in one of your bashrc files (though it should be on by default)
the behaviour you want can then be achieved by doing this (again, best to have it in your rc files somewhere):
# PROMPT_COMMAND='history -a'

With this set, do you still experience the problem?
Comment 10 lnie 2014-06-24 03:00:16 EDT
(In reply to Ondrej Oprala from comment #9)
> Sorry for the late reply.
> 
> There are two things affecting this behaviour.
> Firstly, make sure "shopt -o histappend" is somewhere in one of your bashrc
> files (though it should be on by default)
> the behaviour you want can then be achieved by doing this (again, best to
> have it in your rc files somewhere):
> # PROMPT_COMMAND='history -a'
> 
> With this set, do you still experience the problem?

The problem is gone,thanks for your helpful information
Comment 11 Ondrej Oprala 2014-06-24 08:52:50 EDT
Glad to hear it.

Note You need to log in before you can comment on or make changes to this bug.