Bug 1025130 - Bash doesn't append to history after each command
Summary: Bash doesn't append to history after each command
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Oprala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-31 05:10 UTC by lnie
Modified: 2016-02-01 02:09 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-24 12:52:50 UTC
Type: Bug
Embargoed:


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

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.


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