Bug 1025130

Summary: Bash doesn't append to history after each command
Product: [Fedora] Fedora Reporter: lnie <lnie>
Component: bashAssignee: Ondrej Oprala <ooprala>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: admiller, crobinso, extras-orphan, jonathan, kzak, mluscon, ooprala, ovasik, rvokal, tsmetana, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-24 12:52:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
output none

Description lnie 2013-10-31 05:10:07 UTC
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 13:51:40 UTC
gnome-applet-vm is not the correct component, please re-assign

Comment 2 Karel Zak 2013-11-01 11:35:26 UTC
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-04 04:51:21 UTC
still with f20-beta-RC2

Comment 4 lnie 2013-11-15 05:44:11 UTC
still occurs with f20-final-TC1

Comment 5 lnie 2013-12-11 09:49:31 UTC
(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 08:02:20 UTC
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 09:02:42 UTC
Sure,the output is attached

Comment 8 lnie 2014-05-19 09:03:09 UTC
Created attachment 897056 [details]
output

Comment 9 Ondrej Oprala 2014-06-11 11:41:48 UTC
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 07:00:16 UTC
(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 12:52:50 UTC
Glad to hear it.